Skip to content

Commit

Permalink
Switch to AWS ECR (#409)
Browse files Browse the repository at this point in the history
* Switch to AWS ECR
  • Loading branch information
mat-rumian authored and pmalek committed Apr 13, 2021
1 parent a7e8f00 commit 5fac32c
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,32 @@ commands:
steps:
- run:
name: Build image
environment:
REGISTRY: public.ecr.aws/sumologic
TAG_URL: ${REGISTRY}/<< parameters.repo >>:<< parameters.tag >>
LATEST_URL: ${REGISTRY}/<< parameters.repo >>:latest
command: |
make docker-otelcontribcol
docker tag otelcontribcol:latest sumologic/<< parameters.repo >>:<< parameters.tag >>
docker tag otelcontribcol:latest sumologic/<< parameters.repo >>:latest
- run:
name: Login to Docker Hub
command: docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
docker tag otelcontribcol:latest ${TAG_URL}
docker tag otelcontribcol:latest ${LATEST_URL}
- run:
name: Login to AWS ECR
environment:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLIC_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLIC_ECR_SECRET_ACCESS_KEY }}
REGISTRY: public.ecr.aws/sumologic
command: |
aws ecr get-login-password --region us-east-1
| docker login --username AWS --password-stdin ${REGISTRY}
- run:
name: Push image
environment:
REGISTRY: public.ecr.aws/sumologic
TAG_URL: ${REGISTRY}/<< parameters.repo >>:<< parameters.tag >>
LATEST_URL: ${REGISTRY}/<< parameters.repo >>:latest
command: |
docker push sumologic/<< parameters.repo >>:<< parameters.tag >>
docker push sumologic/<< parameters.repo >>:latest
docker push ${TAG_URL}
docker push ${LATEST_URL}
workflows:
version: 2
Expand Down

0 comments on commit 5fac32c

Please sign in to comment.