当尝试部署一个简单的功能时,我遇到了 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: [[email protected] /cdn-cgi/l/email-protection]
Project: [projectname]
Current Properties:
[core]
project: [projectname]
account: [[email protected] /cdn-cgi/l/email-protection]
disable_usage_reporting: [True]
我尝试向 IAM 中的上述帐户添加以下权限:
- 云构建服务代理
- 云功能开发人员
- 云功能服务代理
- Editor
当 Google Build 运行时,它使用哪个服务帐户?如何更改权限以允许自动部署功能?