[英]Google Cloud Builder - how to trigger build configuration in a subdirectory?
[英]How to fully automate the Google Cloud Build trigger creation
我嘗試通過 sh 腳本完全自動化雲構建觸發器的創建
作為來源,我使用 Github。
到目前為止,可以創建觸發器
gcloud beta builds triggers create github \
--repo-name=organisation/repo \
--repo-owner=organisation \
--branch-pattern="^main$" \
--build-config=cloudbuild.yaml
但是每個回購必須手動授權,否則你會得到錯誤:
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=********* to connect a repository to your project
它將我鏈接到 UI 以手動創建授權
有沒有辦法也使該步驟自動化?
如果您使用另一個托管的 Git 提供商(例如 GitHub 或 Bitbucket),並且仍需要將存儲庫鏡像到 Cloud Source Repositories,則您必須擁有您正在使用的 Google Cloud 項目的 cloudbuilds.builds.create 權限。 此權限通常通過 cloudbuild.builds.editor 角色授予。
以下是此信息的一些鏈接。 創建和管理構建觸發器
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.