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 **_or_**
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:
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. The syntax is of the form: REPOSITORYNAME/BRANCH. In addition, BRANCH is recognized as a shorthand of */BRANCH,
'*'
is recognized as a wildcard, and'**'
is recognized as wildcard that includes the separator '/'. Therefore,origin/branches*
would match origin/branches-foo but not origin/branches/foo, whileorigin/branches**
would match both origin/branches-foo and origin/branches/foo.
As commented, It might be possible that it would work only for hierarchical branch names:
feature/**
, instead of part of a branch name.
So a naming convention like:
ftr/or/hotfix
, with pattern '*/or/*
' or '**/or/**
'ftr_or/hotfix
, with pattern 'ftr_or/**
'could work better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With