Class: ECSHelper::Command::CheckExec
- Inherits:
-
Base
- Object
- Base
- ECSHelper::Command::CheckExec
show all
- Defined in:
- lib/ecs_helper/command/check_exec.rb
Instance Attribute Summary
Attributes inherited from Base
#client, #helper, #option_parser, #options, #type
Instance Method Summary
collapse
Methods inherited from Base
#application, #check_bin, #initialize, #project, #required, #validate
Methods included from Logging
#console, #error, #log
Instance Method Details
#check_exec ⇒ Object
20
21
22
23
|
# File 'lib/ecs_helper/command/check_exec.rb', line 20
def check_exec
exec_cmd = Terrapin::CommandLine.new("check-ecs-exec #{cluster_arn} #{task_arn}")
exec_cmd.run
end
|
#check_exec_bin ⇒ Object
16
17
18
|
# File 'lib/ecs_helper/command/check_exec.rb', line 16
def check_exec_bin
check_bin('check-ecs-exec')
end
|
#cmd_option_parser ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/ecs_helper/command/check_exec.rb', line 6
def cmd_option_parser
options = { command: 'bash -c' }
parser = ::OptionParser.new do |opts|
opts.banner = 'Usage: ecs_helper check_exec'
opts.on('-p VALUE', '--project VALUE', "Set project name, if not specified will look at ENV['PROJECT'], will be used to detect cluster") do |p| options[:project] = processEqual(p) end
opts.on('-a VALUE', '--application VALUE', "Set application name, if not specified will look at ENV['APPLICATION'], will be used to detect service and task definition") do |a| options[:application] = processEqual(a) end
end
[parser, options]
end
|
#printable? ⇒ Boolean
25
26
27
|
# File 'lib/ecs_helper/command/check_exec.rb', line 25
def printable?
true
end
|
#run ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'lib/ecs_helper/command/check_exec.rb', line 29
def run
log("Command", type)
log("Cluster", cluster_arn)
log("Service", service_arn)
log("Task", task_arn)
log("Options", options)
log("Check bin", check_exec_bin)
check_exec
end
|