gpt4 book ai didi

google-cloud-build - 谷歌云构建 : Clone Private Repository on google Cloud Repository failing

转载 作者:行者123 更新时间:2023-12-05 07:31:19 25 4
gpt4 key购买 nike

我们正在使用 Google Cloud Build 测试 Google Cloud Repositories。

我们创建了一个基本的 cloudbuild.yaml 并开始了构建本身(我们使用的是 Go)。

我们的 Go Programm 在同一个存储库(托管在 Google 云存储库)中有一些导入,例如:

  • 源代码/存储库
    • main.go(已导入 source.developers.com/repository/subpackage)
    • 分包/

在包本身中,我们有通过 source.developers.google.com 的导入路径。当 Go 尝试克隆存储库时(运行 go get 时,由于缺少凭据而失败:

Step #0: Cloning into '/workspace/gopath/src/source.developers.google.com/ourrepository'...
Step #0: fatal: could not read Username for
'https://source.developers.google.com': terminal prompts disabled
Step #0: package source.developers.google.com/subpackage: exit status 128 [...]

ERROR: build step 0 "gcr.io/cloud-builders/go" failed: exit status 1

云构建帐户已经可以访问存储库并被允许克隆它。

我们如何使用 Google Build 克隆存储库?

最佳答案

只需转到 Cloud source repository并选择右上角的“克隆”,然后选择一种身份验证方法,最简单的是“Google cloud SDK”,复制命令并在你的命令行中运行 enter image description here

关于google-cloud-build - 谷歌云构建 : Clone Private Repository on google Cloud Repository failing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51895639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com