Skip to content

Instantly share code, notes, and snippets.

@colbydauph
Last active January 9, 2018 03:11
Show Gist options
  • Save colbydauph/e00abe277c2b0fa8c7e990b9405d60df to your computer and use it in GitHub Desktop.
Save colbydauph/e00abe277c2b0fa8c7e990b9405d60df to your computer and use it in GitHub Desktop.
CircleCI + Docker + ECS - Tag Commit
tag_commit:
<<: *job_defaults
environment:
AWS_ACCOUNT_ID: 000000000000
AWS_REGION: us-east-1
steps:
- <<: *setup_remote_docker
- restore_cache:
keys:
- v1-{{ .Branch }}-{{ .Revision }}
- <<: *load_docker_production_cache
- run:
name: Login to Container Registry
command: |
$(aws ecr get-login --no-include-email --region $AWS_REGION)
- run:
name: Tag Image with Commit
command: |
docker tag \
$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1 \
$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
- run:
name: Push Image to Registry
command: |
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment