Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Similar bug to https://github.com/CircleCI-Public/aws-ecs-orb/issues/206 #329

Closed
Sirafe opened this issue Feb 7, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@Sirafe
Copy link

Sirafe commented Feb 7, 2024

Orb version

9.0.2

What happened

Having the same issue with aws-ecr/build_and_push_image that the reporter for the ECS orb was having here with service_update and the ${CIRCLE_SHA1} @ CircleCI-Public/aws-ecs-orb#206
- aws-ecr/build-and-push-image:
checkout: false
auth:
- aws-cli/setup:
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: AWS_REGION
dockerfile: Dockerfile-app
path: ~/project
repo: $repo
push-image: false
region: $region
tag: ${CIRCLE_SHA1:0:7}

Expected behavior

Using ${CIRCLE_SHA1:0:7} Should return only the first 7 characters of the hash. Instead it is returning the full hash.

Additional Information

Expected behavior works with previous version 8.2.1

@Sirafe Sirafe added the bug Something isn't working label Feb 7, 2024
@rel1c
Copy link

rel1c commented Mar 4, 2024

I believe this has to do with the change from eval to env subst. For the meantime, I was able to create a stop gap by inlining the 8.2.1 aws-ecr orb and updating the Ubuntu executor images to current.

@hylaride
Copy link

@Sirafe FWIW, we got around this by injecting the variables before the orb:

    - setup_remote_docker
    - run:
        name: Get 7 digit git sha1
        command: |
          echo 'export SMALL_SHA="${CIRCLE_SHA1:0:7}"' >> "$BASH_ENV"
    - aws-ecr/build_and_push_image:
        - tag: ${SMALL_SHA}

@marboledacci
Copy link
Contributor

Until this is solved in the circleci cli, the solution from @hylaride is the best workaround. I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants