Jenkins - starting a task after completing all subsequent work, not just the nearest

The Jenkins Join plugin allows you to start a task after completing all subsequent subsequent work.

But how can I set up a task that will be launched after completion of all subsequent tasks, and not just the nearest ones?

This figure shows the startup thread that I expect:

A | --+----+------+-- | | vv BC | | --+--------+-----+---+-- | | | | | vvv | DEF | | | | | v | | | G | | | | | | | ---+--------+----+----+-------+-- | v J 

I set Join Trigger to task A to start the final task J. However, job J starts after completion of B and C, does not wait for tasks D, E, F and G.

In this response and his comments, he said that paths can be multiple tasks, and fingerprints should be used correctly. But I can’t figure out how to make it work.

+6
source share
2 answers

The Join plugin works only when everything is broken into β€œdiamonds” of dependencies: one start task, one or several tasks downstream, but only one depth level (D and G are at two levels in the depth of your diagram), then with one joint work . Your dependency structure does not match this diamond pattern.

In this particular situation, I would use the Promoted Builds Plugin . Job assignment job A, when Job J. starts at startup. Make the trigger for this ad successful completion of B, C, D, E, F, G. Or if you want to minimize it: G, EF, C Just make sure that the fingerprint is correctly configured.

For a fingerprint, create a file (or select an existing file) during job A. Artifact and print it. In all subsequent BG works, use the CopyArtifact plugin to get this file in the job and print it there.

+5
source

If someone is looking for an easy way, just use the JobFanIn plugin . This plugin will allow you to set a trigger on task J when C, E, F and G are built and stable

+3
source

Source: https://habr.com/ru/post/924512/


All Articles