Merry xmas guys,
I have got a very basic question that I didn't find out there:
How to build branches one at a time?
I actually have two branches to be built set in my multi-branch pipeline Jenkins process. However, when I hit run, if no changes, both are built at the same time which is a problem due to the unit tests that are using the same port.
This is why I would need to run one branch at a time.
Is there any way in which I can do this?
You cannot limit branches being built with the Multibranch Pipeline. But you can limit that only one step/stage is being run at a time, even across branches, with a lock
If two branches A and B build concurrently, A will first acquire the lock, while B will wait for the lock to be released. So the branches will never execute this locked stage concurrently.