Class: Wrapbox::Runner::Ecs::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/wrapbox/runner/ecs.rb

Instance Method Summary collapse

Instance Method Details

#run_cmd(*args) ⇒ Object



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/wrapbox/runner/ecs.rb', line 354

def run_cmd(*args)
  repo = Wrapbox::ConfigRepository.new.tap { |r| r.load_yaml(options[:config]) }
  config = repo.get(options[:config_name])
  config.runner = :ecs
  runner = config.build_runner
  environments = options[:environments].to_s.split(/,\s*/).map { |kv| kv.split("=") }.map do |k, v|
    {name: k, value: v}
  end
  run_options = {
    task_role_arn: options[:task_role_arn],
    timeout: options[:timeout],
    launch_timeout: options[:launch_timeout],
    launch_retry: options[:launch_retry],
    execution_retry: options[:execution_retry],
    max_retry_interval: options[:max_retry_interval]
  }.reject { |_, v| v.nil? }
  runner.run_cmd(args, environments: environments, **run_options)
end