Skip to content

Commit 90f32fa

Browse files
mat-rumianpmm-sumo
authored andcommitted
Investigate issue with image tagging (#410)
* Move envs into $BASH_ENV * AWS CLI orb
1 parent 55304d8 commit 90f32fa

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

.circleci/config.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ parameters:
1313

1414
orbs:
1515
win: circleci/[email protected]
16+
aws-cli: circleci/[email protected]
1617

1718
executors:
1819
golang:
@@ -111,35 +112,29 @@ commands:
111112
tag:
112113
type: string
113114
steps:
115+
- run:
116+
name: Setup Environment Variables
117+
command: |
118+
echo "export REGISTRY=public.ecr.aws/sumologic" >> $BASH_ENV
119+
echo "export TAG_URL=public.ecr.aws/sumologic/<< parameters.repo >>:<< parameters.tag >>" >> $BASH_ENV
120+
echo "export LATEST_URL=public.ecr.aws/sumologic/<< parameters.repo >>:latest" >> $BASH_ENV
114121
- run:
115122
name: Build image
116-
environment:
117-
REGISTRY: public.ecr.aws/sumologic
118-
TAG_URL: ${REGISTRY}/<< parameters.repo >>:<< parameters.tag >>
119-
LATEST_URL: ${REGISTRY}/<< parameters.repo >>:latest
120123
command: |
121124
make docker-otelcontribcol
122125
docker tag otelcontribcol:latest ${TAG_URL}
123126
docker tag otelcontribcol:latest ${LATEST_URL}
127+
- aws-cli/install
124128
- run:
125129
name: Login to AWS ECR
126-
environment:
127-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLIC_ECR_ACCESS_KEY_ID }}
128-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLIC_ECR_SECRET_ACCESS_KEY }}
129-
REGISTRY: public.ecr.aws/sumologic
130-
command: |
131-
aws ecr get-login-password --region us-east-1
132-
| docker login --username AWS --password-stdin ${REGISTRY}
130+
command: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${REGISTRY}
133131
- run:
134132
name: Push image
135-
environment:
136-
REGISTRY: public.ecr.aws/sumologic
137-
TAG_URL: ${REGISTRY}/<< parameters.repo >>:<< parameters.tag >>
138-
LATEST_URL: ${REGISTRY}/<< parameters.repo >>:latest
139133
command: |
140134
docker push ${TAG_URL}
141135
docker push ${LATEST_URL}
142136
137+
143138
workflows:
144139
version: 2
145140
stability-tests:
@@ -556,4 +551,4 @@ jobs:
556551
fi
557552
- persist_to_workspace:
558553
root: ~/
559-
paths: project/dist/*.<< parameters.package_type >>
554+
paths: project/dist/*.<< parameters.package_type >>

0 commit comments

Comments
 (0)