我正在尝试通过云构建触发器将html代码从一个云源存储库发布到gcp中的一个公共存储桶中。但是,每次推送到master分支时,我都会在构建过程中得到以下错误。
generic::invalid_argument: generic::invalid_argument: if 'build.service_account' is specified, the build must either (a) specify 'build.logs_bucket' (b) use the CLOUD_LOGGING_ONLY logging option, or (c) use the NONE logging option
我正在使用以下cloudbuild.yaml
steps:
- name: gcr.io/cloud-builders/gsutil
args: ["-m", "rsync", "-r", "-c", "-d", ".", "gs://somedomain.com"]
我认为这与云构建相关的服务帐户有关。
下面是我为这个解决方案准备的教程:https://cloud.google.com/community/tutorials/automated-publishing-cloud-build
发布于 2021-08-19 23:37:18
已解决在cloudbuild.yaml末尾添加日志规范并启用IAM API时出现的错误。存储桶和云构建配置位于同一个项目中,因此我不需要向云构建服务帐户授予额外的角色。
options:
logging: CLOUD_LOGGING_ONLY
发布于 2021-08-14 13:02:11
似乎Cloud Build是从特定的服务帐户启动的,并且该帐户没有在日志记录中存储构建日志的权限。
向您在YAML文件中指定的服务帐户授予日志记录管理员(roles/logging.admin)角色。
This document提供了有关配置用户指定的服务帐户的详细信息
发布于 2021-08-24 15:53:14
云构建documentation涵盖了所有可用的日志记录选项。
而(同时)正确的角色应该是roles/storage.admin
。
https://stackoverflow.com/questions/68779751
复制相似问题