From e0a52c3e59ed20262408fdc59a6fd848f9fd804a Mon Sep 17 00:00:00 2001 From: "Mateusz \"mat\" Rumian" <58699800+mat-rumian@users.noreply.github.com> Date: Mon, 21 Dec 2020 10:17:46 +0100 Subject: [PATCH] Investigate issue with image tagging (#410) * Move envs into $BASH_ENV * AWS CLI orb --- .circleci/config.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0391b359df69..d4d52579ff7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,7 @@ parameters: orbs: win: circleci/windows@2.4.0 + aws-cli: circleci/aws-cli@1.3.1 executors: golang: @@ -111,35 +112,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: @@ -556,4 +551,4 @@ jobs: fi - persist_to_workspace: root: ~/ - paths: project/dist/*.<< parameters.package_type >> \ No newline at end of file + paths: project/dist/*.<< parameters.package_type >>