Here is my current Jenkins setup for a project:
This setup allows me to have continuous automated delivery as well as constant feedback during development. The first 3 jobs also run all tests and coverage reports.
The problem is that I could not find a way to exclude the master branch from the "all development branches" job. It unnecessarily builds master twice every time I merge a pull-request.
Does anybody know how to exclude one branch from the job in Jenkins ?
ps: I am using the Git and the Github plugins. My project is stored on Github.
The UI controls to disable and enable Multibranch / Organization items have been fixed in Folders Plugin 6.12 as per JENKINS-60900. Since Folders Plugin 6.12 , you'll be able to enable and disable them by clicking on the Disable Multibranch Pipeline or the corresponding item button.
Head over to your Jenkins instance and create a new item. Enter a name for the job, and select the “Multibranch Pipeline” option at the end of the screen. Then, click on the OK button. In the next screen, go to the “Branch sources” tab, click on the “Add source” button, and choose “Git” from the dropdown menu.
You can choose "Inverse" strategy for targeting branches to build.
Check out Jenkins job configuration,
(Don't forget to fill in "Branches to build" text field by "master")
See also attachment screenshot image:
You can use :^(?!.*master).*$
as the branch specifier in Jenkins and all branches except master will be built. See answer: https://stackoverflow.com/a/18709097/444639
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