【发布时间】:2020-05-25 12:16:36
【问题描述】:
我正在尝试使用 cloudbuild.yaml 部署云功能。如果我不使用任何条件语句,它工作正常。当我使用 if conditional 语句执行 cloudbuild.yaml 文件时遇到错误。什么是正确的写法。以下是我的代码:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
id: deploy
args:
- '-c'
- 'if [ $BRANCH_NAME != "xoxoxoxox" ]
then
[
'functions', 'deploy', 'groups',
'--region=us-central1',
'--source=.',
'--trigger-http',
'--runtime=nodejs8',
'--entry-point=App',
'--allow-unauthenticated',
'--service-account=xoxoxoxox@appspot.gserviceaccount.com'
]
fi'
dir: 'API/groups'
我哪里做错了?
【问题讨论】:
-
这能回答你的问题吗? Google Cloud build conditional step
-
部分回答。我尝试了您的解决方案,但无法解决问题。可能是这样,我不会遵循你的解决方案。
标签: bash google-cloud-platform google-cloud-functions yaml google-cloud-build