Jenkins only builds one branch that was clicked

I would like to configure Jenkins, which only builds one branch that was clicked on github. I tried with leave the field blank in the specification of the branch

But after I complete / clicked all branches, it will be built. I just need only one branch to be just built / configured. How can i do this? Thanks.

+5
source share
1 answer

Did you find pipelines caused by external hooks? If github supports hooks (I don't know that), you can do something like below in the hook message. This will start work only if the code has been ported to the development branch.

while read oldrev newrev ref do if [[ $ref =~ .*/development$ ]]; then curl -s http://jenkins:8080/job/stage/build echo Jenkins pipeline triggered by calling the webservice fi done 
0
source

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


All Articles