Class: Jets::CLI::Stop

Inherits:
Ci::Base show all
Defined in:
lib/jets/cli/stop.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Ci::Base

#build_id, #check_build_id!, #find_build, #run_with_exception_handling, #show_console_log_url, #stop_build

Methods inherited from Base

#initialize, #paginate, #paging_params, rescue_api_error

Methods included from Util::Logging

#log

Methods included from AwsServices

#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2

Methods included from AwsServices::StackStatus

#output_value, #stack_exists?

Methods included from AwsServices::GlobalMemoist

included, #reset_cache!

Methods included from Api

#api, #api_key

Constructor Details

This class inherits a constructor from Jets::CLI::Base

Instance Method Details

#are_you_sure?Boolean

Returns:

  • (Boolean)


25
26
27
28
29
# File 'lib/jets/cli/stop.rb', line 25

def are_you_sure?
  unless @options[:yes]
    sure? "Will attempt to stop the deploy for project #{project_name.color(:green)} build_id #{build_id.color(:green)}"
  end
end

#runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/jets/cli/stop.rb', line 3

def run
  are_you_sure?
  check_build_id!
  run_with_exception_handling do
    stopped = stop_build
    if stopped
      log.info <<~EOL
        Deploy has been stopped: #{build_id}
        If the deploy has already started the CloudFormation update it will continue.
        Please check the logs.

      EOL
      show_console_log_url(build_id)
    end
  end
end

#stack_nameObject Also known as: project_name



20
21
22
# File 'lib/jets/cli/stop.rb', line 20

def stack_name
  "#{Jets.project.namespace}-remote"
end