Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins git plugin and branches

I have a job set up in Jenkins to build all my feature branches (feature/**). It is working nicely with the Build Name Setter plugin to identify different builds with Jenkins branch setter name plugin.

My question is, if there are changes to more than one branch at the same time, will it queue the same job multiple times? Or it will just build first branch (or last branch) that it finds, and next branch will be picked up during next poll and so on? Or it will just build a branch that was changed last and ignore all other branches? I can’t figure this out, and didn’t find it documented clearly.

like image 535
Marathiboy Avatar asked Jan 05 '12 20:01

Marathiboy


2 Answers

Alternatively, you can try the job-per-branch approach. It comes with its own set of problems and depending on the number of branches you're dealing with, you might need tools to help you manage the process:

  • jenkins-build-per-branch
  • jenkins-autojobs
like image 60
gvalkov Avatar answered Oct 12 '22 23:10

gvalkov


This has been a known issue with the Jenkins Git Plugin for some time now. It will only build master, even on changes to specific branches.

An older version used to work correctly, so you may be able to work around this if you install a version prior to 1.1.xxx (1.359 is the last known working version).

As mentioned earlier by Jefromi, you can view the details here: https://issues.jenkins-ci.org/browse/JENKINS-11337, and up vote the issue if desired.

like image 21
CIGuy Avatar answered Oct 13 '22 00:10

CIGuy