Class: Cody::Stop
Instance Method Summary collapse
Methods inherited from Base
#initialize, #run_with_exception_handling
Methods included from AwsServices
Methods included from AwsServices::Helpers
#are_you_sure?, #inferred_project_name, #inferred_stack_name, #project_name_convention, #stack_exists?
Constructor Details
This class inherits a constructor from Cody::Base
Instance Method Details
#build_id ⇒ Object
10 11 12 13 14 15 |
# File 'lib/cody/stop.rb', line 10 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 |
#run ⇒ Object
3 4 5 6 7 8 |
# File 'lib/cody/stop.rb', line 3 def run run_with_exception_handling do codebuild.stop_build(id: build_id) puts "Build has been stopped: #{build_id}" end end |