Sha256: 1bb553d41ce61a20e9e6d25ab05a7547c765f78d26107a0ee25d770dcb8103a8

Contents?: true

Size: 411 Bytes

Versions: 5

Compression:

Stored size: 411 Bytes

Contents

module Cody
  class Stop < Base
    def run
      run_with_exception_handling do
        codebuild.stop_build(id: build_id)
        puts "Build has been stopped: #{build_id}"
      end
    end

    def build_id
      return @options[:build_id] if @options[:build_id]

      resp = codebuild.list_builds_for_project(project_name: @full_project_name)
      resp.ids.first # most recent build_id
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cody-0.8.6 lib/cody/stop.rb
cody-0.8.5 lib/cody/stop.rb
cody-0.8.4 lib/cody/stop.rb
cody-0.8.3 lib/cody/stop.rb
cody-0.8.2 lib/cody/stop.rb