Sha256: 04255bec20d9f413f04017eadd704dc8e876d7258373df7039f5e819f436c56d

Contents?: true

Size: 1.02 KB

Versions: 30

Compression:

Stored size: 1.02 KB

Contents

module Ey
  module Core
    module Cli
      module Helpers
        module LogStreaming

          def stream_deploy_log(request)
            if request.finished_at
              return finished_request(request)
            end
            unless request.read_channel
              puts "Unable to stream log (streaming not enabled for this deploy)".yellow
              return
            end
            request.subscribe { |m| print m["message"] if m.is_a?(Hash) }
            puts "" # fix console output from stream
            finished_request(request)
          end

          def finished_request(request)
            if request.successful
              if request.resource.successful
                puts "Deploy successful!".green
              else
                puts "Deploy failed!".red
              end
            else
              abort <<-EOF
        Deploy failed!
        Request output:
        #{request.message}
              EOF
              .red
            end
          end

        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.6.4 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.6.3 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.6.1 lib/ey-core/cli/helpers/log_streaming.rb
groove-ey-core-3.6.3 lib/ey-core/cli/helpers/log_streaming.rb
groove-ey-core-3.6.2 lib/ey-core/cli/helpers/log_streaming.rb
groove-ey-core-3.6.1 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.5.0 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.4.4 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.4.2 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.4.1 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.4.0 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.3.1 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.3.0 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.6 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.5 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.4 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.3 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.2 lib/ey-core/cli/helpers/log_streaming.rb
ey-core-3.2.1 lib/ey-core/cli/helpers/log_streaming.rb