使用 Bitbucket Cloud 存储库集成和推送触发器时,GCP Cloud Build FETCHSOURCE 失败

问题描述 投票:0回答:1

FETCHSOURCE 步骤失败而未拉下源。

构建日志:

> starting build "205dc86e-b097-4b9f-a431-a0fb8b9796c5"
> 
> FETCHSOURCE
> hint: Using 'master' as the name for the initial branch. This default branch name
> hint: is subject to change. To configure the initial branch name to use in all
> hint: of your new repositories, which will suppress this warning, call:
> hint: 
> hint:     git config --global init.defaultBranch <name>
> hint: 
> hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
> hint: 'development'. The just-created branch can be renamed via this command:
> hint: 
> hint:     git branch -m <name>
> Initialized empty Git repository in /workspace/.git/
> /bin/sh: 4: "; };f: not found
> Reinitialized existing Git repository in /workspace/.git/
> /bin/sh: 4: "; };f: not found
> Reinitialized existing Git repository in /workspace/.git/
> /bin/sh: 4: "; };f: not found
> ERROR
> ERROR: error fetching git source: generic::unknown: retry budget exhausted (3 attempts): fetching git source: fetching git source: source fetch container exited with non-zero status: 127

使用 bitbucket 云上的私有存储库(存储库访问令牌;不是高级帐户)和推送触发器。
当我推送到我的分支时,触发器会正确触发。 构建在几秒钟内失败,日志如上。

我的cloudbuild.yaml显然是从新推送中读取的,因为它显示了我正确的步骤(gcr.io/cloud-builders/docker)和参数(build --network cloudbuild -t gcr.io/project/images/blah .)。当然,我可以更改这些参数并重新推送,这一步的参数将会更改。

如果我使用 gcloud 从命令行手动构建(绕过 bitbucket 获取),则此构建有效:

gcloud 构建提交 --region=us-central1 --config cloudbuild.yaml .

我的期望是,至少会获取我的分支的代码,然后下一个(第一个)构建步骤将从 cloudbuild.yaml 运行。

google-cloud-build
1个回答
0
投票

确保您使用 Bitbucket 云配置了 Cloud Build。查看这些文档:

  1. 连接到 Bitbucket 云主机

  2. 连接到 Bitbucket 云存储库

  3. 从 Bitbucket Cloud 构建存储库

由于从命令行手动运行时构建成功,问题可能出在 Bitbucket 的配置上。您还可以联系 Google Cloud 支持 进一步调查您的案例。

© www.soinside.com 2019 - 2024. All rights reserved.