Jenkins – Throttle concurrent build depending on executor and workspace

  Kiến thức lập trình

I’m trying to find a solution to control the execution of different jobs like so:
I have a bunch of machines that all have the same workspace format > Jenkins/workspace/W1
All the jobs use the same workspace, and can run on all the machines, but there should only be one job running on the same machine at once.

So for example:
Machines: B1, B2, B3 (all have a workspace named W1)
Jobs: J1, J2

J1 is triggered on B1 – should run
J2 is triggered on B2 – should run, because workspace W1 is available on B2
J1 is triggered on B3 – should run, because workspace W1 is available on B3
J2 is triggered on B1 – should wait for execution of J1, because W1 is not available on B1

So basically I need to control the throttling of builds depending on the workspace availability of a machine, not on the job. I know the default behavior of Jenkins is to create W2 in case W1 is not available and that is something I want to avoid 100%.

New contributor

Ioana Coman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT