Sha256: 137076ed77c5504738b3e154220823d19dcaa9d27ed6a3beb2a112ac84315bbe

Contents?: true

Size: 1.05 KB

Versions: 32

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(configuration)
    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
    configuration.each do |env, target, _data|
      configuration.environment = env
      configuration.target = target

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

      message = "Cannot open remote shell to host '#{configuration[: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

32 entries across 32 versions & 1 rubygems

Version Path
fulmar-1.10.1 lib/fulmar/domain/task/configuration.rake
fulmar-1.10.0 lib/fulmar/domain/task/configuration.rake
fulmar-1.9.2 lib/fulmar/domain/task/configuration.rake
fulmar-1.9.1 lib/fulmar/domain/task/configuration.rake
fulmar-1.9.0 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.15 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.14 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.13 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.12 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.11 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.10 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.9 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.8 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.7 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.6 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.5 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.4 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.3 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.2 lib/fulmar/domain/task/configuration.rake
fulmar-1.8.1 lib/fulmar/domain/task/configuration.rake