【问题标题】:Is there a way to "link" a github repository using gcloud CLI有没有办法使用 gcloud CLI “链接” github 存储库
【发布时间】:2021-01-20 18:55:56
【问题描述】:

我正在尝试自动创建 Google Cloud 项目并将 Google Cloud Build 设置为自动构建 github 存储库。

但在使用 gcloud CLI 创建触发器之前,我必须“链接”远程 github 存储库,但我还没有找到有关如何执行此操作的线索。

如果我不这样做,我有以下错误:

ERROR: (gcloud.beta.builds.triggers.create.github) FAILED_PRECONDITION: Repository mapping does not exist. Please visit https://console.cloud.google.com/cloud-build/triggers/connect?project=ID to connect a repository to your project

我的 github 存储库使用 Google Cloud Build github 应用来实现云构建集成。

【问题讨论】:

    标签: github google-cloud-platform build gcloud


    【解决方案1】:

    Google documentation 中关于创建触发器的部分有gcloud beta

    如果您的源代码在 GitHub 中,则创建触发器:

        gcloud beta builds triggers create github \
        --repo-name=[REPO_NAME] \
        --repo-owner=[REPO_OWNER] \
        --branch-pattern=".*" \
        --build-config=[BUILD_CONFIG_FILE] \ ```
    

    请查看gcloud reference 获取命令。

    【讨论】:

    • 是的,我看到了,但它给了我同样的错误:ERROR: (gcloud.beta.builds.triggers.create.github) FAILED_PRECONDITION: Repository mapping does not exist. Please visit https://console.cloud.google.com/cloud-build/triggers/connect?project=ID to connect a repository to your project
    • 在 GUI 之外确实无法链接自身。因此,谷歌云存储库可以实现自动化。我建议报告功能请求cloud.google.com/cloud-build/docs/…
    猜你喜欢
    • 1970-01-01
    • 2021-09-30
    • 2019-09-08
    • 2013-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多