首页 > 解决方案 > 为什么我的 Jenkins 停止通过 Webhooks 响应 BitBucket 推送?

问题描述

我们设置了 Bitbucket,以便在每次推送时调用 Jenkins ( https://jenkins.MYORG.com/bitbucket-hook/ )。它已经工作了好几年。然后在 2 月初,Jenkins 构建停止被触发。

Bitbucket 在通话中将每次推送注册为 200(截至 2021 年 2 月 18 日): 推送日志

但 Jenkins 看到的最后一个 webhook 是 2021 年 2 月 3 日:

Started on Feb 3, 2021 2:50:53 PM
Using strategy: Default
[poll] Last Built Revision: Revision 77642d1711b318ce5429e6c532661cf74808b724 (refs/remotes/insight/develop)
using credential 6fdd775e-c5fb-4a52-9210-caa8a8bd6671
 > C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials XXX Bitbucket Login
 > C:\Program Files\Git\bin\git.exe ls-remote -h -- https://bitbucket.org/XXX/insight.git # timeout=10
Found 100 remote heads on https://bitbucket.org/XXX/insight.git
[poll] Latest remote head revision on refs/heads/develop is: 77642d1711b318ce5429e6c532661cf74808b724 - already built by 33
Done. Took 3.9 sec
No changes

Jenkins 分支设置为“*/develop”

提交正文(请询问是否有任何有用的内容)具有以下内容:

"new": {
          "name": "develop",
          "links": {
            "commits": {
              "href": "https://api.bitbucket.org/2.0/repositories/xxx/insight/commits/develop"
            },
            "self": {
              "href": "https://api.bitbucket.org/2.0/repositories/xxx/insight/refs/branches/develop"
            },
            "html": {
              "href": "https://bitbucket.org/xxx/insight/branch/develop"
            }
          },

所以他们似乎是一致的。存储库 URL 直接转到 Bitbucket 中的存储库,凭据有效,触发器设置为“将更改推送到 BitBucket 时构建”。我完全不解。有人有想法么?

谢谢,迈克

标签: gitjenkinsbitbucket

解决方案


问题是我们的 StackPath 没有 Bitbucket 的所有 IP 范围,所以当它切换时,我们阻止了推送。


推荐阅读