Closed rodolfoIOET closed 1 year ago
Hi @rodolfoIOET
would your project on CircleCI be a private repository? If so, can you submit a support ticket here @ https://circleci.zendesk.com/hc/en-us/requests/new ? From there, we (Support team) can dig deeper and look at your CircleCI build to advise further.
Thank you!
I am running into the same thing. For me! it looks like when you pass the when:
parameter in IT IS NOT passing to the "Install AWS CLI - latest" AND "Configure AWS Access Key ID" steps. These steps are notably missing when the step before fails.
- run:
name: "Check the pre-existence of the deploy"
command: |
echo "${DEPLOY_PATH}"
sideshow staging is_deployed ${DEPLOY_PATH}
- when:
condition:
equal: [ master, << pipeline.git.branch >> ]
steps:
- backup_deploy:
bucket: staging
current: "${DEPLOY_PATH}"
when: on_success
- aws-s3/copy:
arguments: |
--cache-control "public, max-age=15" \
--acl bucket-owner-full-control
from: build/code-snippet.js # build/${FILENAME}
to: "s3://staging/sideshow/${DEPLOY_PATH}"
when: always
hi @qops1981 @rodolfoIOET, thanks for reporting this.
I believe the issue is because:
aws-s3/copy
command does not propagate its when
parameter to aws-cli/setup
:
https://github.com/CircleCI-Public/aws-s3-orb/blob/d76b756615b0c423b978a9fc0a329d952b5863a3/src/commands/copy.yml#L56-L75aws-s3/copy
is used with when: on_fail
or when: always
, if the earlier step before aws-s3/copy
failed, this internal aws-cli/setup
step will not run since the last step exited non-zeroTo solve this, i think we would need to propagate the when
parameter value to aws-cli/setup
.
We would then expect the aws-cli/setup
to also respect this when
value.
However, this is tricky too, since the aws-cli/setup
command does not currently accept a when
parameter:
https://circleci.com/developer/orbs/orb/circleci/aws-cli#commands-setup
This likely requires some coordination on our team (CircleCI) to update both Orbs.
In the meantime, to unblock your cases, we can pre-emptively install the AWS CLI first. As such, can you try to modify your .circleci/config.yml as shown below?
# snippet; incomplete .circleci/config.yml
orbs:
aws-s3: circleci/aws-s3@3.1.1
+ aws-cli: circleci/aws-cli@3.1.4
jobs:
example:
docker:
- image: cimg/python:3.10
steps:
+ - aws-cli/setup
- run: echo "some required commands that may fail"
- aws-s3/copy:
- install-aws-cli: true
+ install-aws-cli: false
# or, when: always
when: on_fail
...
@kelvintaywl, sorry I forgot to update. To solve this, I used aws-cli solely as a workaround (without aws-s3). I haven't tried the suggested solution by @kelvintaywl
@kelvintaywl This worked to unblock me! Thank you very much.
Hey All!
We've come out with a new standard for all AWS orbs where a user will be required to authenticate first. This means that you'll have to run the aws-cli/setup
command first to authenticate first before using any of the S3 commands.
Thanks @kelvintaywl for your guidance!
Best, Brian
Orb version 3.1.1
Describe the bug I'm getting "/bin/bash: line 14: aws: command not found" when using "aws-s3/sync"
To Reproduce
my_job: docker:
Expected behavior
successfully set up aws-cli, because "install-aws-cli" param is default to true
Additional context I think this is because the Shebang used in the orb source: #!/bin/sh and this might be related https://github.com/CircleCI-Public/aws-s3-orb/issues/4