我正在尝试在远程 AWS Windows Server 2016 数据中心上运行 BitBucket 管道。
image: python:3.5.1
pipelines:
custom: # Pipeline that only runs manually
default:
- step:
caches:
- pip
script: # Modify the commands below to build your repository.
- pip install awscli
- <-
aws ssm send-command
--document-name "AWS-RunRemoteScript"
--instance-ids "i-000000000000000"
--parameters '{\"sourceType\":[\"S3\"],\"sourceInfo\":[\'{\"path\":\"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1\"}\'],\"executionTimeout\":[\"3600\"],\"commandLine\":[\"test.ps1\"],\"workingDirectory\":[\"C:\\\\TOM\"]}'
--timeout-seconds 600
--region us-east-2
当我尝试运行管道时,出现以下错误:
+ <- aws ssm send-command --document-name "AWS-RunRemoteScript" --instance-ids "i-000000000000000" --parameters '{\"sourceType\":[\"S3\"],\"sourceInfo\":[\'{\"path\":\"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1\"}\'],\"executionTimeout\":[\"3600\"],\"commandLine\":[\"test.ps1\"],\"workingDirectory\":[\"C:\\\\TOM\"]}' --timeout-seconds 600 --region us-east-2
bash: /opt/atlassian/pipelines/agent/tmp/bashScript5876925824407417765.sh: line 8: unexpected EOF while looking for matching `''
我已经研究了 2-3 次语法,但不确定到底是什么问题。我在命令中看不到任何额外的单引号。任何帮助将不胜感激。
更新 1:
@rici:
+ aws ssm send-command --document-name "AWS-RunRemoteScript" --instance-ids "i-0000000000000000" --parameters '{"sourceType":["S3"],"sourceInfo":['\''{"path":"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1"}'\''],"executionTimeout":["3600"],"commandLine":["test.ps1"],"workingDirectory":["C:\\TOM"]}'
Error parsing parameter '--parameters': Invalid JSON: Expecting value: line 1 column 36 (char 35)
JSON received: {"sourceType":["S3"],"sourceInfo":['{"path":"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1"}'],"executionTimeout":["3600"],"commandLine":["test.ps1"],"workingDirectory":["C:\\TOM"]}
更新 2:
+ aws ssm send-command --document-name "AWS-RunRemoteScript" --instance-ids "i-0000000000000000" --parameters '{\"sourceType\":[\"S3\"],\"sourceInfo\":["{\"path\":\"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1\"}"],\"executionTimeout\":[\"3600\"],\"commandLine\":[\"test.ps1\"],\"workingDirectory\":[\"C:\\\\TOM\"]}' --timeout-seconds 600 --region us-east-2
Error parsing parameter '--parameters': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
JSON received: {\"sourceType\":[\"S3\"],\"sourceInfo\":["{\"path\":\"https://s3.us-east-2.amazonaws.com/my-bucket-name/test.ps1\"}"],\"executionTimeout\":[\"3600\"],\"commandLine\":[\"test.ps1\"],\"workingDirectory\":[\"C:\\\\TOM\"]}