Hudson / Jenkins - Parallel vs Series Pipelines and Reuse of jobs
I have a series of Hudson jobs I want to run to test out various builds:
- Build 1.17 on Server X
- Build Trunk on Server X
- Test1
- Test2
I want to do run these jobs in series with each job waiting for the other to finish: Build 1.17, Test1, Test2, Build Trunk, Test1, Test2
On the other hand, I have two other jobs Test3 and Test4, which can be run in parallel, and just after Build Trunk.
I'd prefer not to have to chain multiple jobs together from the post-build-steps section of each job, but this is the only way I can make them run in series. The problems with this are: 1) Job Duplication: I need 2 copies of Test1 and Test2: Build 1.17-> Test1 -> Test2 -> Build Trunk -> Test1 (copy for trunk) -> Test2 (copy for trunk). 2) More Duplication: I need another Build Trunk so I don't run Test1 every time I want to run Test3 an开发者_运维百科d Test4.
Is there a simple way to have jobs operate in series without modifying the individual jobs and creating dependencies between them outside of a top-level job?
UPDATE: Eventually what we did is use Rakefiles to manage the whole process. None of the plugins were robust enough for this. A hudson job calls a Rakefile with args which calls other hudson jobs.
Have a look at the Locks and Latches plugin - this lets you set up more complex build dependencies without having to duplicate your jobs.
Have a look at the (relatively new) Multijob Plugin. You can then define multiple phases that get executed in series, with all jobs within a phase running in parallel. For your example, set up 6 phases. Phase 1 running Build 1.17, phase 2 running Test 1, etc. In phase 5 (after Build Trunk), you can run Test 3 and Test 4 in parallel.
Alternatively, build two separate pipelines with the Build Pipeline Plugin to start each pipeline manually.
BTW, the Locks and Latches plugin is deprecated, superseded by the Throttle Concurrent Builds Plugin. This works as a charm to avoid for instance running Test 3 and Test 4 jobs together on the same slave (and overload the slave).
精彩评论