Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Git plugin included regions not working

Tags:

git

jenkins

I cannot get the "included regions" feature to work in Jenkins with the Git plugin. I want a job only to be built when there a changes in "his" directory. Example: the project mytool should only be build when there are changes under GIT_ROOT/tools/mytool/. I tried several forms for the regex in the included regions field:

 /tools/mytool/.*
 tools/mytool/.*
 ^tools/mytool/.*

With any of these regexes the result is the same: mytool builds every time a change is commited - no matter where. I also tried the excluded regions the same way - also not working. What am I doing wrong?

like image 300
mithrandir Avatar asked Oct 28 '13 15:10

mithrandir


2 Answers

For me it started working when checking "Force polling using workspace" under "Source-Code-Management - Additional Behaviours" in the job config. Smells like a bug - there are several open regarding the included/excluded regions feature of the git plugin.

EDIT: it stopped working after updating jenkins and the git plugin. The cause is probably:

https://issues.jenkins-ci.org/browse/JENKINS-20607

I am thinking of moving to this method here

like image 152
mithrandir Avatar answered Sep 19 '22 17:09

mithrandir


I just had this problem, and the answer was slightly different than the other answers. That being said, the solution lay in the question itself. For me, I had paths in the "Included Regions" with the pattern:

service/Search/AbstractSearchServices/master/**/*

I changed the pattern to:

service/Search/AbstractSearchServices/master/.*

Once I changed to that pattern, it worked perfectly for me.

like image 20
entpnerd Avatar answered Sep 20 '22 17:09

entpnerd