Sha256: 9e578c31f053d5834dcbe26b19a8f902866b0782b6e4a9dd54bb79e4fc7b2399

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'pp'

namespace :test do
  task :config do
    require 'fulmar/domain/service/config_test_service'
    test_service = Fulmar::Domain::Service::ConfigTestService.new(config)
    results = test_service.run

    results.each do |report|
      case report[:severity]
      when :warning
        warning "Warning: #{report[:message]}"
      when :error
        error "Error: #{report[:message]}"
      else
        info "Notice: #{report[:message]}"
      end
    end

    info "Feelin' fine." if results.empty?
  end

  task :hosts do
    error_count = 0
    config.each do |env, target, _data|
      config.environment = env
      config.target = target

      next if config[:hostname].blank?
      remote_shell.quiet = true
      remote_shell.strict = false

      info "Testing #{env}:#{target}..."

      message = "Cannot open remote shell to host '#{config[:hostname]}' (#{env}:#{target})"

      begin
        remote_shell.run('true') || error(message)
      rescue
        error(message)
      end
    end
    info "Feelin' fine." if error_count == 0
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fulmar-2.0.2 lib/fulmar/domain/task/configuration.rake
fulmar-2.0.1 lib/fulmar/domain/task/configuration.rake
fulmar-2.0.0 lib/fulmar/domain/task/configuration.rake