问题描述
我正在通过teamcity步骤在bash脚本中运行以下awscli命令
#!/bin/bash
repo=%env.RepoName%
echo "repo is ${repo}"
tags=%env.Tags%
echo "tags are ${tags}"
aws ecr create-repository --repository-name ${repo} --tags '${tags}'
其中%env.RepoName%
和%env.Tags%
是团队性变量,其值分别为sample-repo
和[{"Key":"env","Value":"dev"},{"Key":"dept","Value":"finance"}]
。但是,当aws cli命令运行时,它会错误并显示以下错误
Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
但是,如果我用单引号将%env.Tags%
的值传递为'[{"Key":"env","Value":"finance"}]'
,并从aws cli命令的tags属性中排除了''
,它将运行没有问题。
我想念的是什么?有没有建议的方法来解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)