0

We have branches set up like this:

  • origin/develop
  • origin/release/1.0.0
  • origin/release/1.1.0

Bitbucket

In the BitBucket, we have added Hook called "Bitbucket Server Webhooks to Jenkins" & Automatic merging is enabled.

Under the Advanced Configuration:

Branch Options is set to All and refs/remotes/origin/develop refs/remotes/origin/release/* in the input box.

Jenkins

For Jenkins, under "Source Code Management" section and "Branches to Build" option we have added the following:

Branch Specific (blank for 'any'): ${Branch}
Branch Specific (blank for 'any'): **release/*

Problem

Jenkins picks up build when we push to develop. Nothing happens when we push to any of the release branches.

Also tried manually: http://server/job/Jenkins%20Bitbucket%20Test/buildWithParameters?Branch=release/1.0.0, but this triggers a build for release/1.1.0 and not release 1.0.0.

jmogera
  • 1,689
  • 3
  • 30
  • 65

1 Answers1

1

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, while origin/branches** would match both origin/branches-foo and origin/branches/foo.

Therefore my **release/* needs to be *release/**

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
jmogera
  • 1,689
  • 3
  • 30
  • 65