Class: Actions::ForemanPipeline::Job::JobHook

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/foreman_pipeline/job/job_hook.rb

Instance Method Summary collapse

Instance Method Details

#rescue_strategy_for_selfObject



17
18
19
# File 'app/lib/actions/foreman_pipeline/job/job_hook.rb', line 17

def rescue_strategy_for_self
  Dynflow::Action::Rescue::Skip
end

#runObject



7
8
9
10
11
12
13
14
15
# File 'app/lib/actions/foreman_pipeline/job/job_hook.rb', line 7

def run
  fail "Multiple jobs defined for the same content view and environment: #{input[:job_names]}.
       This may result in an unexpected behaviour.
       Resolve the conflict to avoid skipping this action." if input[:job_names].length > 1
  jobs = input[:job_ids].map { |id| ::ForemanPipeline::Job.find id }
  jobs.map do |job|
    ForemanTasks.trigger(DeployNewHost, job)
  end
end