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

Multiple tags per image #20

Closed
Vlaaaaaaad opened this issue Feb 26, 2019 · 4 comments
Closed

Multiple tags per image #20

Vlaaaaaaad opened this issue Feb 26, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Vlaaaaaaad
Copy link

Orb version

3.0.0

What happened

Currently images can only have 1 tag as per your example due to how the job is written:

version: 2.1

orbs:
  aws-ecr: circleci/aws-ecr@3.0.0

workflows:
  complete_build_and_push:
    jobs:
      - aws-ecr/build_and_push_image:
          aws-access-key-id: ACCESS_KEY_ID_ENV_VAR_NAME
          aws-secret-access-key: SECRET_ACCESS_KEY_ENV_VAR_NAME
          region: AWS_REGION_ENV_VAR_NAME
          account-url: AWS_ECR_ACCOUNT_URL_ENV_VAR_NAME
          repo: myECRRepository
          # ECR image tag, defaults to "latest"
          tag: ${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}

Expected behavior

There is a desire for an image to have multiple tags, in our case both the ${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}, the ${CIRCLE_SHA1}, and say latest.

version: 2.1

orbs:
  aws-ecr: circleci/aws-ecr@3.0.0

workflows:
  complete_build_and_push:
    jobs:
      - aws-ecr/build_and_push_image:
          aws-access-key-id: ACCESS_KEY_ID_ENV_VAR_NAME
          aws-secret-access-key: SECRET_ACCESS_KEY_ENV_VAR_NAME
          region: AWS_REGION_ENV_VAR_NAME
          account-url: AWS_ECR_ACCOUNT_URL_ENV_VAR_NAME
          repo: myECRRepository
          tag: [ ${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}, ${CIRCLE_SHA1}, "latest"]

This is currently blocked by https://ideas.circleci.com/ideas/CCI-I-701 which asks for list parameters to be enabled.

Are there any workaround for this?

@kgriffiths
Copy link

This would be great to have

@iynere
Copy link
Contributor

iynere commented Jun 20, 2019

yeah we can definitly make this happen even without a list-type parameter. it would have to be a comma-separated string, which would then be parsed out in the orb source code

@iynere
Copy link
Contributor

iynere commented Jun 20, 2019

i see there are a lot of upvotes on this issue—does anyone wanna take a crack at a PR ?

here's some examples of how we usually do this:

https://github.com/CircleCI-Public/slack-orb/blob/staging/src/commands/notify.yml#L92-L101
https://github.com/CircleCI-Public/gcp-binary-authorization-orb/blob/master/src/commands/configure-policy.yml#L151-L181

if not, we will get to it eventually, but it will have to get slotted behind a few other things

@iynere iynere added the enhancement New feature or request label Jun 20, 2019
@KyleTryon KyleTryon self-assigned this Jun 20, 2019
@ricoli ricoli mentioned this issue Jul 22, 2019
3 tasks
@lokst lokst self-assigned this Sep 11, 2019
@lokst
Copy link
Contributor

lokst commented Sep 11, 2019

Resolved in versioncircleci/aws-ecr@6.3.0 (See: #45)

@lokst lokst closed this as completed Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants