Jenkins not triggering build on PR merged in bitbucket

Viewed 293

We are using Bitbucket cloud to host our repos and Jenkins for CI/CD.

I have setup a multibranch pipeline which has develop and release branches. I want to trigger develop branch whenever a PR is merged from the feature branches to develop a branch (In fact on any manual webhook edit).

Below are the cases I tried:

  1. Setup Manage hook in Jenkin:
  • This creates a webhook in bitbucket and when PR is merged, build is triggered.
  • But when I disable the Repository Push option in the webhook, the build is not triggering on PR merge.
  1. Setup the webhook manually:
  • In this case, the Jenkins logs show the branch name as PR-XY since not triggering the develop branch.
  • I have set up a regex to filter branches (only develop and release are allowed) and when I add regex like PR(.*) then build gets triggers from the PR section (not desired case).

I want the build to be triggered from the develop branch, not as the PR branch. I have followed most of the options available in the forums but it's not working. Any help regarding this will be appreciated.

0 Answers
Related