Class: Ufo::Task
- Inherits:
-
Object
- Object
- Ufo::Task
- Includes:
- AwsServices, Defaults
- Defined in:
- lib/ufo/task.rb
Instance Method Summary collapse
-
#initialize(task_definition, options) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object
Methods included from AwsServices
Methods included from Defaults
#default_cluster, #default_desired_count, #default_maximum_percent, #default_minimum_healthy_percent, #new_service_settings, #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 |
# 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!(overrides: overrides) if @options[:command] resp = ecs.run_task() puts "Task ARN: #{resp.tasks[0].task_arn}" unless @options[:mute] end |