Jenkins 使用 Bitbucket 服务器集成插件进行构建
我可以通过 BitBucket 服务器集成插件触发 Jenkins 中的构建,该插件会自动在 BitBucket 上设置 Webhook。
我看到提出拉取请求时会触发构建。 但是,我注意到,当构建在 Jenkins 上运行时,如果拉取请求得到更新,那么我不会看到下一个构建在 Jenkins 中排队。 当更新的引用的当前构建完成时,构建确实会执行,但为什么我没有看到它排队? 如果存在多个拉取请求,则会出现相同的行为。
理想情况下,拉取请求应该能够同时构建。
我在 Jenkins 中有以下设置来触发并行构建。不确定,我在这里缺少什么
当拉取请求更新时,我确实看到从 Bitbucket 发送有效负载。
在 Jenkins 日志上,我发现了一个错误:
INFO com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl handleError
Bitbucket - Path not found
如果找不到路径,那么我可以理解我这边存在一些配置问题,但是一旦当前构建完成,它就会触发另一个构建。
问题是:
- 为什么我不能使用 BitBucket 服务器集成插件并行构建多个拉取请求?
- 如果 Jenkins 确实在内部对构建进行排队,那么为什么它不显示在 Jenkins UI 上?
I am able to trigger builds in Jenkins via BitBucket Server Integration plugin which automatically sets a webhook on BitBucket.
I see build getting triggered when a pull request is raised.
However, I am noticing that when a build is running on Jenkins and if the pull request gets updated then I don't see next build getting queued in Jenkins.
Build does get executed when the current build completes for the updated ref but why don't I see it getting queued?
Same behavior is seen if there are multiple pull-requests.
Ideally, pull requests should be able to be built concurrently.
I do have below setting in Jenkins to trigger parallel builds. Not sure, what I am missing here
I do see payload being sent from Bitbucket when Pull request is updated.
And on Jenkins log I found an error:
INFO com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl handleError
Bitbucket - Path not found
If path was not found then I can understand there is some configuration issue on my end but once the current build completes it does trigger another build.
Problem is:
- Why can't I build multiple pull request in parallel using BitBucket Server Integration Plugin?
- If Jenkins does queue the build internally then why doesn't it show on the Jenkins UI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前也遇到过类似的问题。
基本上我的理解是 Jenkins 无法区分来自 Bitbucket webhook 的事件。你基本上需要一个差异化因素。
我所做的是,根据有效负载输入对我的网络钩子侦听器作业进行参数化。
这里对我来说最重要的是添加日期时间,因为我有很多请求几乎同时来自 bitbucket。
希望这对您的设置有所帮助。
I had similar issue before.
Basically what I understand is that Jenkins cannot differentiate the events that are coming from Bitbucket webhook. You basically need a differentiator.
What I did is, make my web-hook listener job parameterised based on the payload input.
Here the most important thing for me was to add the date-time, because I have many requests coming at almost same time from bitbucket.
Hopefully this will help in your setup.