1

In a declarative pipeline parallel block, it is possible to specify multiple stages to execute in parallel on agents with the same node.

Let's say we have 3 stages defined and only two nodes available.

Stage A: 2 hrs Stage B: 2 hrs Stage C: 4 hrs

I want to be sure that stage C starts first, because then the total execution time will be 4 hrs. If A and B start first, then total execution will be 6 hours.

Is there any way to ensure Stage C is given priority to start first when all three stages are started using a parallel block?

0

Here is a hack that should work - run them all in parallel just add sh 'sleep 5m' in A and B stage. Just ensure that you have at least 3 executors on node you run it ;)

But still if you run them all in parallel it should be only 4 hours not 6 hours.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.