Project

General

Profile

Download (901 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman_pipeline / app / lib / actions / foreman_pipeline / jenkins / build_project.rb @ be52ca64

1
module Actions
2
  module ForemanPipeline
3
    module Jenkins
4
      class BuildProject < AbstractJenkinsAction
5
                
6
        def plan(options)
7
          sequence do
8
            build_task = plan_action(Build, options)
9
            wait_task = plan_action(WaitForBuild, :job_id => options[:job_id], :name => options[:project_name], :build_num => build_task.output[:build_num])
10
            
11
            plan_self(:build_status => wait_task.output[:details][:result], :name => options[:project_name])
12
          end
13
        end
14

    
15
        def run
16
          output[:status] = input[:build_status]
17
          Dynflow::Action::Rescue::Skip if input[:build_status].match /^FAILURE$/
18
        end
19

    
20
        def rescue_strategy_for_self
21
          Dynflow::Action::Rescue::Skip
22
        end
23

    
24
        def humanized_name
25
          "Build Jenkins Project: %s" % input[:name]
26
        end
27
      end
28
    end
29
  end
30
end