Bitbucket pull request builder plugin keeps triggering same commit build

折月煮酒 提交于 2019-12-21 11:57:23

问题


I need to integrate Bitbucket with Jenkins. So that whenever a PR is opened it will trigger a build in Jenkins. Then commit status of the last commit in the PR will be updated as failed or success and this commit wont trigger the build again. (This works beautiful with Github but seems to be a nightmare for me with Bitbucket)

So far I did:

  • Installed Bitbucket pull request builder plugin.
  • Set everything up like its described in https://github.com/jenkinsci/bitbucket-pullrequest-builder-plugin#readme
  • User has write permissions to the repository (we added shh pub key to organization and its in the group that has write permissions)

Problems

  1. Build is triggered over and over again for the same PR/commit
  2. Commit status is not updated on bitbucket

Let me know if I can provide more information.


回答1:


In my case, the Jenkins URL was set to http://jenkins:8080 and when such a URL was sent to BitBucket via their API, BitBucket returned the error "Invalid URL" (Look in Jenkins Logs: http://yourjenkins:8080/log/all) Which is not handled by the BitBucket Pull Request Builder plugin and thus kept continuously rebuilding all of our pull requests because it thought that build was not in progress. After setting Jenkins URL to http://jenkins.domain.tld:8080/ or http:///jenkins, the BitBucket API started accepting the URL and everything started to work.

But in your case it may be possible that some other error is the cause. You can check your Jenkins Error log to see the failure.

See the following issue: Build status notification fails with Enter a valid URL



来源:https://stackoverflow.com/questions/36184110/bitbucket-pull-request-builder-plugin-keeps-triggering-same-commit-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!