I'm trying to upload a zip file from bitbucket pipeline to AWS S3.
The step is in bitbucket-pipelines.yml like below:
- step: #dev-int-module-sam-s3bucket
name: Deploy to DevEnv
- echo $POC_DEPLOY_S3_BUCKET
- aws s3 cp dev-int-module-sam.zip s3://$POC_DEPLOY_S3_BUCKET/dev-int-module-sam.zip
My pipeline failed at this step and the output:
+ echo $POC_DEPLOY_S3_BUCKET
+ aws s3 cp dev-int-module-sam.zip s3://$POC_DEPLOY_S3_BUCKET/dev-int-module-sam.zip
Unknown options: /dev-int-module-sam.zip
The echo returns the right value but cannot use it in "aws s3 cp" command, It's weird.
Other variables works well, such as AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY.
Many thanks for any suggestion.
This looks as if there is a space or similar non-printable character at the end of `$POC_DEPLOY_S3_BUCKET`. You could verify with the echo:
And for the AWS CLI command, quoting might preserve it (and make the error more visible):
aws s3 cp dev-int-module-sam.zip "s3://$POC_DEPLOY_S3_BUCKET/dev-int-module-sam.zip"
Quoting is most often a good idea when doing variable interpolation to keep arguments together.
...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events