为什么Jenkins使用正确的AWS CLI语法标记错误?

时间:2018-10-17 03:01:58

标签: jenkins-pipeline aws-cli

我在Jenkins管道中对shell命令的引号转义时遇到问题,所以我在How to escape quotes in a AWS CLI in a Jenkins pipeline?中问,已回答,现在在运行命令时引号已正确转义。

但是,当我在管道中执行以下aws elbv2 CLI命令时,在Jenkins中得到了以下内容

+ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-east-1:1234567890:listener/app/my-alb/123456789 --default-actions '[{"Type": "redirect", "RedirectConfig": {"Protocol": "HTTPS", "Port": "443", "Host": "#{host}", "Query": "#{query}", "Path": "/#{path}", "StatusCode": "HTTP_301"}}]'

Error parsing parameter '--default-actions': Expected: '=', received: ''' for input:
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'

如果我在--default-actions后面加上“ =”符号(如错误消息所述,我会遇到相同的错误。)

如果我将在Jenkins中执行的命令复制/粘贴到终端中,它将起作用!

0 个答案:

没有答案