I'm using Jenkins 2 with the Bitbucket Branch Source Plugin which scans and builds all the branches and PRs.
My problem is that when I push code to a PR, the branch is built twice (one for the branch and one for the PR). I would like to build only master and PRs.
Do someone knows how to do that ? I can't find any documentation about this.
From the Branch Indexing Log
(wihtout filter):
Checking branch branch-name from repo/project
Met criteria
Scheduled build for branch: branch-name
...
Checking PR from repo/project and branch branch-name
Met criteria
Scheduled build for branch: PR-123
Then when I try to filter on PR-* nothing is scanned. I just get:
Checking branch branch-name from repo/project
You can just separate your terms with a space. For your include try:
master PR-*
When you are configuring your Bitbucket sources, you can use Include branches
or Exclude branches
(in Advanced
params) to include/exclude some branches :
And based on Bitbucket Branch source plugin source code, both fields takes an Ant regex.
So assuming all your PR branches start with "pr-" you could use a regex in include branches
, e.g. :
(?:master|pr-).*
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