Class: Ufo::Task
Instance Method Summary collapse
-
#initialize(task_definition, options) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object
Methods included from AwsService
#cloudwatchlogs, #ecr, #ecs, #elb
Methods included from Util
#default_cluster, #default_params, #display_params, #execute, #pretty_time, #settings
Constructor Details
#initialize(task_definition, options) ⇒ Task
Returns a new instance of Task.
6 7 8 9 10 |
# File 'lib/ufo/task.rb', line 6 def initialize(task_definition, ) @task_definition = task_definition @options = @cluster = @options[:cluster] || default_cluster end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ufo/task.rb', line 12 def run puts "Running task_definition: #{@task_definition}".colorize(:green) unless @options[:mute] return if @options[:noop] = { cluster: @cluster, task_definition: @task_definition } = .merge(default_params[:run_task] || {}) if @options[:command] .merge!(overrides: overrides) puts "Running task with container overrides." puts "Command: #{@options[:command].join(' ')}" end unless @options[:mute] puts "Running task with params:" display_params() end resp = ecs.run_task() puts "Task ARN: #{resp.tasks[0].task_arn}" unless @options[:mute] end |