Jenkins to not allow the same job to run concurrently on the same node?

Posted by Marek Gimza on Stack Overflow See other posts from Stack Overflow or by Marek Gimza
Published on 2012-06-22T14:37:53Z Indexed on 2012/06/22 21:16 UTC
Read the original article Hit count: 144

Filed under:

I have 4 nodes and 2 jobs. Any node can run 2 jobs concurrently and any job can be executed concurrently. I want to be able to restrict running the same job concurrently on the same machine. For example:

Jobs: J1 and J2 nodes: N1,N2,N3 and N4

I can run J1 and J2 on the same node at the same time. I can run J1 on N1 and N3 at the same time. BUT I do not want to run J1 and another build of J1 on the same node at the same time.

I have tried "Locks and Latches", "Jenkins Exclusive Execution", "Exclusion Plugin" plugins, and these will work well when trying to coordinate different jobs. But my case is trying to manage different build-instances of the same job.

© Stack Overflow or respective owner

Related posts about jenkins