Bitbucket拉取请求构建器插件不断触发相同的提交构建 [英] Bitbucket pull request builder plugin keeps triggering same commit build
问题描述
我需要将Bitbucket与Jenkins集成.这样,只要打开PR,它就会触发Jenkins的构建.然后,PR中最后一次提交的提交状态将更新为失败或成功,并且该提交不会再次触发构建. (这在Github上效果很好,但在Bitbucket看来对我来说就像一场噩梦)
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)
到目前为止,我做到了:
- 已安装Bitbucket拉取请求构建器插件.
- 按照 https://github.com/jenkinsci中所述进行设置/bitbucket-pullrequest-builder-plugin#readme
- 用户对存储库具有写许可权(我们向组织及其具有写许可权的组中添加了shh pub密钥)
问题
- 针对相同的PR/commit一遍又一遍地触发构建
- 提交状态不会在位桶上更新
让我知道是否可以提供更多信息.
Let me know if I can provide more information.
推荐答案
在我的情况下,Jenkins URL设置为http://jenkins:8080
,并且当这样的URL通过其API发送到BitBucket时,BitBucket返回错误无效的URL". (查看Jenkins日志:http://yourjenkins:8080/log/all
)这不是由BitBucket Pull Request Builder插件处理的,因此由于认为构建未进行,因此不断重建所有我们的Pull Request.将Jenkins URL设置为http://jenkins.domain.tld:8080/
或http:///jenkins
之后,BitBucket API开始接受该URL,一切开始正常工作.
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.
但是在您的情况下,可能是其他一些错误引起的.您可以检查您的Jenkins错误日志以查看失败.
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.
请参阅以下问题:构建状态通知失败,并输入有效的URL
这篇关于Bitbucket拉取请求构建器插件不断触发相同的提交构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!