Shivam Seth
Shivam Seth

Reputation: 687

Execute Jenkins job after multiple parallel jobs (of different nested level) get executed

I want "Last Job" to trigger after execution of Jobs "A1, B3 and B4). So Main job should trigger "Job A and Job B" in parallel Then "Job A and Job B" should call "Job A1 and Job B1". Then "Job B1" should call "Job B2" Then "Job B2" should call "Job B3 and Job B4" in parallel After execution of all "Job A1, Job B3 and Job B4" "Last job" should execute

Screenshot

Jenkins jobs flow

Upvotes: 1

Views: 580

Answers (1)

Krzysztof Błażełek
Krzysztof Błażełek

Reputation: 893

You can use Multijob plugin to achieve such workflow. In short:

  • You can run multiple jobs inside phase in pararell
  • Phases run sequentially
  • Multijobs can call other multijobs

In your example:

  • Main Job will have 2 phases. Phase 1 will call A and B. Phase 2 will call Last Job.
  • A will have 1 phase that calls A1
  • B will have 1 phase that calls B1
  • B1 will have 1 phase that calls B2
  • B2 will have 1 phase that calls B3 and B4

So everything will be a multijob apart from lastjob, A1, B3 and B4.

Upvotes: 1

Related Questions