【发布时间】:2019-06-06 17:09:51
【问题描述】:
在尝试部署一个简单的功能时,我遇到了 403 错误。这是我的完整 yaml:
steps:
# Install Dependencies
- name: 'python'
id: Pip install
args: ['pip3', 'install', '-r', 'requirements.txt', '--user']
# Run Tests
- name: 'python'
args: ['python3', '-m', 'pytest', 'functions/folder_a/test/']
# Deploy Cloud Functions
- name: 'gcr.io/cloud-builders/gcloud'
id: 'helloFunction'
args: ['functions', 'deploy', 'hello', '--source' , 'functions/folder_a/main.py',
'--runtime' , 'python37' ,'--trigger-http']
第一步完成得很好,但是第二步出错了。
$ gcloud info
Account: [projectname@appspot.gserviceaccount.com]
Project: [projectname]
Current Properties:
[core]
project: [projectname]
account: [projectname@appspot.gserviceaccount.com]
disable_usage_reporting: [True]
我尝试在 IAM 中为上述帐户添加以下权限:
- 云构建服务代理
- 云功能开发人员
- 云功能服务代理
- 编辑器
当 Google Build 运行时,它使用的是哪个服务帐户?如何更改权限以允许自动部署功能?
【问题讨论】:
标签: google-cloud-platform google-cloud-functions google-cloud-build