BitBucket Jenkins doesn't automatically build

后端 未结 14 943
予麋鹿
予麋鹿 2020-12-30 21:44

On my Jenkins I configured:

Source Code Management

Git repository: https://bitbucket.org/username/project.git

credentials: username/

14条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 22:26

    After some struggling with the BitBucket plugin, I have managed to get it working. Below is the summary of things I found are necessary for builds to be triggered, but are not obvious from plugin's documentation:

    1. Make sure your webhook has repository push trigger enabled. I thought pull request created / updated would suffice (building on PR is what I wanted) but the plugin reacts only to push.
    2. Set your repository URL (in Git plugin) to https://bitbucket.org/REPOSITORY_OWNER/REPOSITORY_NAME. Plugin will not match it if it's the SSH url.
    3. You do need the SCM polling enabled. The plugin itself does not pull the changes. You can leave the schedule field empty, so repository is polled only when the plugin triggers it.

    I hope this helps. If the build is still not triggered for you, try enabling logs for the following classes:

    • com.cloudbees.jenkins.plugins.BitbucketHookReceiver
    • com.cloudbees.jenkins.plugins.BitBucketTrigger
    • com.cloudbees.jenkins.plugins.BitbucketJobProbe
    • com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor
    • com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource

提交回复
热议问题