Why is Jenkins flagging an error with correct AWS CLI syntax?

本秂侑毒 提交于 2020-01-06 14:42:07

问题


I was having issues with escaping quotes for a shell command in Jenkins pipeline, so I asked in How to escape quotes in a AWS CLI in a Jenkins pipeline?, which was answered and the quotes are now escaped correctly when I run the command.

However I get the following in Jenkins when I execute the following aws elbv2 CLI command in a pipeline

+ 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"}}]'

If I put an "=" sign after --default-actions, like the error message says, I get the same error.

If I copy/paste the command I execute in Jenkins into a terminal, it works!

来源:https://stackoverflow.com/questions/52846705/why-is-jenkins-flagging-an-error-with-correct-aws-cli-syntax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!