Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins/Hudson - How to run multiple jobs in parallel more than 1 level deep?

I'm trying to get the following workflow running in Jenkins, in parallel. So for example, both A and B running at the same time. As soon as A finishes run A2 and A3 at the same time, etc...

It seems like a pretty common use case but most plugins I tried do no support more than 1 level deep, which is the case with the A branch below. Join plug-in doesn't seem helpful here.

I read about using the Promotion plugin but I'm a little mystified on what to fingerprint/artifacts to archive to make this work.

Any clue on how to make this simple build pipeline work?

flow

like image 358
vdsf Avatar asked Nov 13 '12 18:11

vdsf


1 Answers

As jgritty pointed out you could use the Build flow plugin. In order to get the type of parallel execution you want you could run something equivalent to the following build flow script:

buildTrigger = build("Trigger")

parallel(
    {
        buildA = build("A")
        buildA1 = build("A1")
        parallel(
            {
                buildA2 = build("A2")
            },
            {
                buildA3 = build("A3")
            },
        )
    },
    {
        buildB = build("B")
        buildB1 = build("B1")
    },
)

buildResults = build("GatherResult")

In this script the first parallel block takes care of the A and B branches. Once in a branch each build is sequential until you add more parallel blocks.

like image 183
Petrik Avatar answered Sep 19 '22 18:09

Petrik