【发布时间】:2021-02-23 19:45:22
【问题描述】:
我有一个如下所示的构建配置文件:
steps:
...
<i use the ${_IMAGE} variable around 4 times here>
...
images: ['${_IMAGE}']
options:
dynamic_substitutions: true
substitutions:
_IMAGE: http://example.com/image-${_ENVIRON}
我触发构建如下:
gcloud builds submit . --config=config.yaml --substitutions=_ENVIRON=prod
我期望 gcloud 在我的脚本中替换 _ENVIRON 变量,然后替换 _IMAGE 变量,以便它扩展为“http://example.com/image-prod” - 但我是收到以下错误:
ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: generic::invalid_argument: key "_ENVIRON" in the substitution data is not matched in the template
我能做些什么来完成这项工作?我真的希望能够使用 sub 轻松更改环境,而无需更改代码中的任何内容
【问题讨论】:
标签: gcloud substitution