I have a build in Jenkins triggered by Gerrit I would like to trigger on all branches except master
. What regex should I use for this?
Dynamic triggering 0 of the plugin, a new way of configuring what projects, branches and files to trigger on is available. By checking the checkbox "Dynamic Trigger Configuration", the user is asked for the URL to a file. Branch and file lines are assumed to be part of the closest preceding project line.
Jenkins SetupCreate a new Multibranch Pipeline item. Select Branch Source of type Gerrit . Specify project repository URL, only http or https based protocol is supported at this point, copy the URL from project settings at Gerrit. Trigger Scan Multibranch Pipeline now either manually or by external trigger.
Using a negative lookahead worked for me:
^(?!.*master).*$
Should trigger on everything except master. Kudos to this questions answers.
The following worked for me:
^(master.+|(?!master).*)$
This excludes master only. Not master_joda, for example.
It is also based on these answers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With