How to call a build flow from a build flow passing different parameters?

大兔子大兔子 提交于 2019-12-08 08:50:29

You can use Workflow Plugin to achieve what you want.

  1. job1, job2 and job3 must be parameterized jobs with param1 and param2 as parameters (they can be freestyle jobs or whatever you want).
  2. Create a parameterized Workflow job with param1 and param2 as parameters. The workflow script would be something like this:

    build job: 'job1', parameters: 
      [[$class: 'StringParameterValue', name: 'param1', value: param1],
       [$class: 'StringParameterValue', name: 'param2', value: param2]]
    build job: 'job2', parameters: 
      [[$class: 'StringParameterValue', name: 'param1', value: param1],
       [$class: 'StringParameterValue', name: 'param2', value: param2]]
    build job: 'job3', parameters: 
      [[$class: 'StringParameterValue', name: 'param1', value: param1],
       [$class: 'StringParameterValue', name: 'param2', value: param2]]
    
  3. Then just run the top level job, it will ask you for parameters values and downstream jobs will be triggered (and top level parameters passed).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!