Search code examples
jenkinsjenkins-pipelinejenkins-plugins

How to configure Jenkins to build the branch I pushed to a bitbucket repository


My repository is Bitbucket. I use generic-webhook-trigger to trigger build on a specific branch, take the branch dev1 as an example. I created a Jenkins job. The "Branches to build" > "Branch Specifier" is dev1. I configured Bitbucket webhook. It triggers build in Jenkins on the branch dev1 whenever there is a "git push" to dev1 branch.

I would like to be able to trigger builds on any branches I git pushed. Developers create new branches while they are developing code. They prefer Jenkins can trigger builds on the branches they git pushed. How to do this?


Solution

  • You could just leave the branch specifier as blank instead of setting it to dev1:

    Specify the branches if you'd like to track a specific branch in a repository. If left blank, all branches will be examined for changes and built.