Sha256: 2cf38a627dcf29ea455ef3562a4b3bfdb2e969588c3b3b826fec2ca63ae7af56

Contents?: true

Size: 642 Bytes

Versions: 8

Compression:

Stored size: 642 Bytes

Contents

module Cody
  class Status < Base
    def run
      run_with_exception_handling do
        puts "Build id: #{build_id}"
        resp = codebuild.batch_get_builds(ids: [build_id])
        build = resp.builds.first
        puts "Build status: #{colored(build.build_status)}"
      end
    end

  private
    def colored(status)
      # one of SUCCEEDED FAILED FAULT TIMED_OUT IN_PROGRESS STOPPED
      case status
      when "SUCCEEDED"
        status.color(:green)
      when "FAILED", "FAULT", "TIMED_OUT"
        status.color(:red)
      when "IN_PROGRESS"
        status.color(:yellow)
      else
        status
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cody-0.9.8 lib/cody/status.rb
cody-0.9.7 lib/cody/status.rb
cody-0.9.6 lib/cody/status.rb
cody-0.9.5 lib/cody/status.rb
cody-0.9.4 lib/cody/status.rb
cody-0.9.3 lib/cody/status.rb
cody-0.9.2 lib/cody/status.rb
cody-0.9.1 lib/cody/status.rb