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


i have 3 jobs (let's name job1,job2,job3) accepts same parameters. have build flow calling these jobs eg build flow::

build(job1, param1 : "value1", param2 : "value2" ) build(job2, param1 : "value1", param2 : "value2" ) build(job3, param1 : "value1", param2 : "value2" ) 

as see in example jobs accept same parameters.

and want run same sequence in build flow (job1, job2, job3) different parameter values. having different build flows pass different values parameter:

eg:

build flow1--- build(job1, param1 : "value1", param2 : "value2" ) build(job2, param1 : "value1", param2 : "value2" ) build(job3, param1 : "value1", param2 : "value2" )  build flow2--- build(job1, param1 : "value3", param2 : "value4" ) build(job2, param1 : "value3", param2 : "value4" ) build(job3, param1 : "value3", param2 : "value4" ) 

i thinking have build flow shared , able pass parameters : example:::

build flow build(job1, param1 : $paramvalue1, param2 : $paramvalue2 ) build(job2, param1 : $paramvalue1, param2 : $paramvalue2 ) build(job3, param1 : $paramvalue1, param2 : $paramvalue2 ) 

and want call build flow different parameter values build flow.

can ??? if yes ,, 1. how define , pass parameter flow ?

you can use workflow plugin achieve want.

  1. job1, job2 , job3 must parameterized jobs param1 , param2 parameters (they can freestyle jobs or whatever want).
  2. create parameterized workflow job param1 , param2 parameters. workflow script 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 run top level job, ask parameters values , downstream jobs triggered (and top level parameters passed).


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -