Jenkins build only one branch that has been pushed Jenkins build only one branch that has been pushed jenkins jenkins

Jenkins build only one branch that has been pushed


Did you consider the pipelines triggered by external hooks? If github support hooks (I don't know it) you can do something like below in post-receive hook. This will run the job only if the code was pushed to the development branch.

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