Jenkins 多分支管道 - 创建 PullRequest 时不会从 Bitbucket 触发扫描

Jenkins Multibranch Pipeline - scan is not triggered from Bitbucket when a PullRequest is created

我们已配置 Jenkins 多分支管道以自动构建功能分支,这些分支在 Bitbucket 中作为拉取请求提交。对于 Bitbucket(Server) 中的 Webhook creatin,我们使用 Jenkins 的参数化构建。 在 Jenkins 中,我们已经成功地配置了它,可构建的分支被检测到,就像一个魅力。

问题是我必须告诉 Jenkins 每 2 分钟检查一次新分支,我宁愿在创建、合并或更改 PR 时通知 Jenkins。来自 Bitbucket 的所有其他通知工作得很好,多分支构建中的更改会导致自动构建,none 多分支管道上的正常构建也可以工作。

有人知道为什么无法从 Bitbucket 触发扫描吗?如果有人需要,我可以提供我的配置截图... 谢谢 卡斯滕

您需要向 Bitbucket 中的每个存储库添加相应的 Webhook,以便在特定操作时触发构建。我们在 Bitbucket (https://marketplace.atlassian.com/apps/1215474/post-webhooks-for-bitbucket?hosting=server&tab=overview) but you could even use the default Webhook implementation in Bitbucket (described here https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html)

中使用了一个额外的插件

Jenkins 中的端点由 Multibranch 插件定义。是这个:“YOUR_JENKINS_URL/bitbucket-scmsource-hook/notify”

请参阅 https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-BitBucket-Server- 以获得很好的指南。