In one jenkins job, we want to track multiple branches and trigger it only once when there are changes in any of them. Is that possible?
The problem is, that we have to run a bunch of jobs for each branch serially and they should not interfer. What we want to achieve is for example:
[changes on any branch] -> checkout master -> job1 -> job2 -> job3 -> checkout release -> job1 -> job2 -> job3
The current behaviour is, that the job gets triggered for each branch that has changes. So, if the 'build pipeline' has been triggered because of changes in master, it's possible to be triggered again caused by changes in release:
[changes on master] -> checkout master -> job1 -> ... -> checkout release -> ...
[changes on release] -> checkout master -> job1 -> ... -> checkout release -> ...
Another (even better) option would be, to start one job periodically and do the build stuff for each branch only, if it has changes:
for each branch do
if branch has changes then
job1
job2
...