Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins executing one job that runs multiple jobs

i am new to Jenkins , i need to execute one job that run's another multiple jobs in parallel were it should not stop even if one job fails.

i am not sure how to achieve it. After googling i can achieve by 3 ways Multi-Job plugin , Pipeline multiple Jenkins jobs , Build after other projects , Build Flow Plugin.

can any body please provide me the correct way.

Update : i am trying to achieve this using the pipeline plugin , can any body suggest me were it was correct choice ?..Please suggest!..

like image 765
ramakri Avatar asked Mar 21 '17 19:03

ramakri


3 Answers

We use the Parameterized Trigger Plugin to do this.

In your build configuration add a Trigger/call builds on other projects build step. Add the names of the builds you want to trigger as a comma separated list and make sure that the Block until triggered projects finish their builds box is unchecked. Your build will trigger each of the listed builds, however note that your parent build won't wait for them to finish it will just trigger them and then perform the rest of it's buildsteps so if you have buildsteps.

If you do want to wait then check the block until triggered builds finish box, but set the options for when to fail the build, build step or mark the build as unstable appropriately.

If you need to pass parameters to the jobs you can add parameters using this plugin. If your downstream jobs need different parameters for different jobs you can click the add trigger button which adds another project to build where you can specify different options.

If these other jobs are follow up jobs to the current job and you don't need to wait for them to finish you can also achieve what you want to do by using the post build action build other projects, but again this occurs after the current job and you won't be able to use the results.

can any body please provide me the correct way.

I wouldn't approach using Jenkins with a "one correct way" mentality. Often times the requirements of your build will dictate which method or plugin you use in your build configurations.

like image 117
Tuffwer Avatar answered Nov 15 '22 04:11

Tuffwer


The job can start other jobs via the jenkins api.

like image 45
Steven Dashevsky Avatar answered Nov 15 '22 04:11

Steven Dashevsky


updated Answer : i used pipeline plugin to achieve my task and tuffwer was right to if u have paramaterized trigger plugin!..

like image 27
ramakri Avatar answered Nov 15 '22 03:11

ramakri