简体   繁体   中英

Jenkins Git Plugin Build Trigger RegEx starts wrong jobs

I am using Jenkins (v1.592) with Git Client Plugin (v1.12.0) and Git Plugin (v2.3).

I have a build-job that has to be triggered if there have been changes in my git-repository if the changes are made NOT in origin/master or origin/name branches, while N is a decimal number.

I was very happy to see, that Jenkins allowes regular expressions as a branch-specifier at the "Branches to build" option. But unfortunately I do not get my expression to work correctly:

My expression is:

:master|name(\d+)

I also activated "Strategy for choosing what to build" with option "Inverse".

When I am now pushing something onto my master-build it will be selected and the build starts.

I am using "Poll SCM" with no schedule and trigger a build with a call to the Jenkins notifyCommit URL.

I also tried to use: (?!(origin/master|origin/name\\d+)) as regex without inverse option but get an error here.

Okay, I found an answer, but not by finding a solution for the regex. I recently saw, that I am able to specify more than one branch with the "Add Branch" function - until few minutes ago I was blind to see the "Add Branch" button.

By specifiying two branches and activating the inverse function it works. My two branch names are: master and name* (* for the Wildcard operator).

Thanks for your help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM