Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define jobs in Jenkins/Hudson to run in parallel?

PROBLEM: Given a number of jobs in Jenkins/Hudson, each assigned a number we can call level. This number ranges from 1 to n, and multiple jobs can have the same level. Now, I would like to define those (otherwise independent) jobs to run such that level 1 must build before level 2, and I would like Jenkins/Hudson to start multiple jobs at the same level in parallel if the slave executors on which the jobs are defined are free.

What this level number is doesn't matter, it's just defined to explain the problem.

IMPORTANT: I would like the possibility of generating those jobs automatically, because I know which jobs depend of which and which can run in parallel, so if the solution is some configuration in the config.xml, it would be nice to hear about that, such that I can script automatic generation of those configuration files.

Jobs at level X can and should run in parallel, as many as possible.

Thanks for your time.

EDIT: There is one more that I would like to know, in case there is some elegant solution: given that job X is triggered by Build Flow Plugin, and it fails. Is there any way if I want the Build Flow Plugin to trigger the same job again (after I have fixed it), and continue normally for the of the jobs defined through the plugin?

like image 730
Gogi Avatar asked May 15 '12 19:05

Gogi


1 Answers

There is a relatively new plugin for Jenkins, called Build Flow plugin. This plugin provides a new Job type, where you can define such job dependency structures with a DSL. I think, you can also do this automatically. The plugin is very powerful, you can find more infos here. I don't know, if this plugin will also work in Hudson, since it requires Jenkins 1.424 as minimum version, and the newest Hudson version has also changed its configuration xml.

like image 160
dunni Avatar answered Nov 04 '22 05:11

dunni