Hello,
I am chaining jobs together to implement automated tests. Two of the jobs require rebooting the slave.
To illustrate what I'm talking about, I have these jobs:
J1 does some setup and reboots
J2 runs some tests
J3 does some cleanup and reboots
J2 has a configured quiet period to allow the slave to come back on-line following J1's reboot
J1 has a configured quiet period, because we can't start the pipeline again until the slave is back on-line following J3's reboot.
I've throttled the three jobs so that only one of them at a time can be building on a given slave.
They are also configured such that J2 must run on the same slave that J1 was run on and J3 must run on the same slave as J2.
My first problem is that, often times, an instance of J1 gets queued up (due to source code change) before a running instance of J1 has completed.
So, the queued J1 runs before J2. That's not good!
Is there a way to tell Jenkins "If any of the jobs in the pipeline are already running or queued, don't queue another job on that slave"?
To make things even more interesting/challenging, if another slave becomes available, it is OK to start a new pipeline on a different slave.
So, for any given slave, J1 must be followed by J2 and J2 must be followed by J3.
Thanks in advance for your ideas.