将 Bitbucket 存储库镜像到 GCP 云源存储库时出现问题

Problem mirroring Bitbucket repo to GCP Cloud Source Repo

我正在尝试为 GCP Cloud Functions 和 App-Engine 部署设置 CICD。该存储库位于 Bitbucket 中,我按照 here 中的说明在我的 Bitbucket 存储库和 GCP Cloud Source 存储库之间创建镜像。

使用 GCP 云源“Connect external repository”UI 我可以 select 我的 GCP 项目,select Bitbucket 作为 Git 提供商,使用我的凭据(我是 Bitbucket 存储库的管理员)连接到 Bitbucket,然后 select 所需的 Bitbucket 存储库。然后,当我单击 "Connect selected repository" 时,我得到了大约 30 秒的延迟,最后是一条简单的 "Failed to connect repositories" 错误消息,没有进一步解释原因。 GCP 日志记录没有显示任何内容。

如有任何想法,我们将不胜感激。

谢谢

确保您已启用源代码库API。回想起来,我想这是显而易见的,因为 Bitbucket webhook 需要调出 Google 的 API 来宣布 repo 发生更改时。

GCP API 名为 Cloud Source Repositories API,服务名称为 sourcerepo.googleapis.com

https://console.cloud.google.com/apis/api/sourcerepo.googleapis.com