How can I tell Jenkins to compile some, but not all branches of a repository?
At my place of work, we use a 2 letter coded naming convention when creating git branches.
For example, feature Apple, might be ftr_ap_hotfix and feature Orange might be done in branch ftr_or_hotfix.
I want to create two separate jobs in Jenkins. One job should compile all branches that match the name
**_ap_** and the other job should compile all branches that match the name
However, when I set this up, Jenkins is compiling all branches no matter their name.
What am I doing wrong? Is there a better way to do this?
The only help I get from the Jenkins page is as follows:
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. The
syntax is of the form: REPOSITORYNAME/BRANCH. In addition, BRANCH is
recognized as a shorthand of */BRANCH,
'*'is recognized as a
'**'is recognized as wildcard that includes the
separator ‘/’. Therefore,
origin/branches-foo but not origin/branches/foo, while
origin/branches**would match both origin/branches-foo and
One Solution collect form web for “How can I tell Jenkins to compile some, but not all branches of a repository?”
As commented, It might be possible that it would work only for hierarchical branch names:
, instead of part of a branch name.
So a naming convention like:
ftr/or/hotfix, with pattern ‘
*/or/*‘ or ‘
ftr_or/hotfix, with pattern ‘
could work better.