lib/mikoshi/plan/task_definition.rb in mikoshi-0.5.1 vs lib/mikoshi/plan/task_definition.rb in mikoshi-0.6.0

- old
+ new

@@ -21,9 +21,15 @@ rescue => e invoke_failed_hooks raise e end + def runtask(cluster: nil) + raise ArgumentError, 'cluster name is required.' if cluster.nil? + + resp = @client.run_task(task_definition: @data[:task_definition][:family], cluster: cluster) + end + private %w[before after].each do |step| define_method "invoke_#{step}_register_hooks" do invoke_hooks @data[:hooks]["#{step}_register".to_sym] unless @data.dig(:hooks, "#{step}_register".to_sym).nil?