2

I am using Jenkins2 and GitHub plugin for triggering Push events.

I have the next service (Jenkins Github): http://myjenkinsmaster/github-webhook/

I also have 3 branches: dev, stage, master which need to be built.

But I require only the branch with changes to be built.

For example if changes were pushed to dev, only dev branch will be built, and others ignored.

However, Jenkins builds all 3 branches which I specified in branch field in job config.

How can I achieve a Jenkins build that builds only the branch where changes were pushed?

  • Do you use pipelines for jenkins jobs? – Here_2_learn Jun 6 '18 at 14:22
1

Finally I have resolved it with the help of "strategy of choosing what to build" with "Default behavior" for each branch.

  • Please elaborate your answer. Your answer will help others as well, so adding more explanation and a screenshot always helps :) – Vish Apr 6 '18 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.