Class: ECSHelper::Command::CheckExec

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from ECSHelper::Command::Base

Instance Method Details

#check_execObject



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_binObject



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_parserObject



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

Returns:

  • (Boolean)


25
26
27
# File 'lib/ecs_helper/command/check_exec.rb', line 25

def printable?
  true
end

#runObject



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