CircleCI-Public / aws-s3-orb

Integrate Amazon AWS S3 with your CircleCI CI/CD pipeline easily with the aws-s3 orb.
https://circleci.com/orbs/registry/orb/circleci/aws-s3
MIT License
10 stars 20 forks source link

about arguments in aws s3 sync #56

Open JooeunAhn opened 1 year ago

JooeunAhn commented 1 year ago

Orb Version aws-s3: circleci/aws-s3@4.0

Describe the bug

In orb version 4.0, I tried to ignore hidden files when aws sync. to do that I tried to use like this

      - aws-s3/sync:
          arguments: --delete --exclude '.*'
          from: ./
          to: {target}

but ci runs like that and then it failed to ignore hidden files...

aws s3 sync ./ s3://web-docs-apne1-stg/CINF-2620-test/ --profile default --delete --exclude ''\''.*'\'''

is there any way to do that without escaping? thanks! To Reproduce

Expected behavior

Additional context

kzk-maeda commented 11 months ago

I've encountered the similar issue. In my case, I've written circle ci configuration like this:

      - aws-s3/sync:
          arguments: |
            --cache-control "public,max-age=31536000,immutable" \
            --exclude "index.html"
          from: dist
          to: << parameters.s3_url >>

Then, the job failed as below:

aws s3 sync dist s3://bucket/path --cache-control '"public,max-age=31536000,immutable"' '\
--exclude' '"index.html"'

Unknown options: \
--exclude,"index.html"

Exited with code exit status 252
marboledacci commented 1 day ago

Try to use an = instead of an empty space to separate the key and the value, for example --exclude=index.html instead of --exclude index.html. This way bash doesn't have problem identifying the multiple parameters.

@JooeunAhn I tried your example with "--delete --exclude=.*" and it worked fine.

@kzk-maeda In your case there's an extra problem which is the \ used to split lines, try it in a single line to avoid issues, or ignore the \ and see if it works.