Skip to content

Commit

Permalink
Investigate issue with image tagging (#410)
Browse files Browse the repository at this point in the history
* Move envs into $BASH_ENV
* AWS CLI orb
  • Loading branch information
mat-rumian authored and pmalek committed Apr 23, 2021
1 parent 193165b commit 0d79189
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:

orbs:
win: circleci/[email protected]
aws-cli: circleci/[email protected]

executors:
golang:
Expand Down Expand Up @@ -108,35 +109,29 @@ commands:
tag:
type: string
steps:
- run:
name: Setup Environment Variables
command: |
echo "export REGISTRY=public.ecr.aws/sumologic" >> $BASH_ENV
echo "export TAG_URL=public.ecr.aws/sumologic/<< parameters.repo >>:<< parameters.tag >>" >> $BASH_ENV
echo "export LATEST_URL=public.ecr.aws/sumologic/<< parameters.repo >>:latest" >> $BASH_ENV
- 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 ${TAG_URL}
docker tag otelcontribcol:latest ${LATEST_URL}
- aws-cli/install
- 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}
command: aws ecr-public 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 ${TAG_URL}
docker push ${LATEST_URL}
workflows:
version: 2
stability-tests:
Expand Down Expand Up @@ -554,4 +549,4 @@ jobs:
fi
- persist_to_workspace:
root: ~/
paths: project/dist/*.<< parameters.package_type >>
paths: project/dist/*.<< parameters.package_type >>

0 comments on commit 0d79189

Please sign in to comment.