Jenkins Git Build Trigger RegEx plugin launches incorrect jobs

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

I have a build task that should be called if there have been changes in my git repository, if the changes were NOT made in the start / main or origin / name branches, and N is a decimal number.

I was very pleased to see that Jenkins allows regular expressions as a branch specifier in the "Branches for assembly" option. But, unfortunately, I do not believe that my expression works correctly:

My expression:

:master|name(\d+) 

I also activated the "Choosing what to build strategy" with the "Reverse" option.

When I click on my master assembly now, it will be selected and the assembly will begin.

I use "Poll SCM" without a schedule and run the build with the Jenkins notifyCommit notification URL.

I also tried using: (?! (Origin / master | origin / name \ d +)) as a regex without an inverse option, but getting an error here.

+6
source share
1 answer

Ok, I found the answer, but did not find a solution for the regex. Recently, I saw that I can specify several branches with the Add Branch function - until a few minutes ago I was blind to see the Add Branch button.

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

Thank you for your help!

+6
source

Source: https://habr.com/ru/post/979058/


All Articles