Skip to content

Commit da51bde

Browse files
authoredMar 13, 2023
QUA-958: Push images to Dockerhub instead of GCR (eslint-8) (#587)
* Push images to Dockerhub instead of GCR
1 parent 189f8fc commit da51bde

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed
 

‎.circleci/config.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ jobs:
2525
circleci step halt
2626
fi
2727
- run: make image
28-
- run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io
28+
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
2929
- run:
30-
name: Push image to GCR
30+
name: Push image to Dockerhub
3131
command: |
32-
docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
33-
us.gcr.io/code-climate/codeclimate-eslint:b$CIRCLE_BUILD_NUM
34-
docker push us.gcr.io/code-climate/codeclimate-eslint:b$CIRCLE_BUILD_NUM
32+
make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
33+
make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')"
3534
3635
workflows:
3736
version: 2
3837
build_deploy:
3938
jobs:
4039
- test
4140
- release_images:
41+
context: Quality
4242
requires:
4343
- test
4444
filters:
@@ -47,4 +47,4 @@ workflows:
4747

4848
notify:
4949
webhooks:
50-
- url: https://cc-slack-proxy.herokuapp.com/circle
50+
- url: https://cc-slack-proxy.herokuapp.com/circle

‎Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
.PHONY: image test test.unit test.integration test.system citest.base citest integration yarn.lock yarn.add
1+
.PHONY: image test test.unit test.integration test.system citest.base citest integration yarn.lock yarn.add release
22

33
IMAGE_NAME ?= codeclimate/codeclimate-eslint
4+
RELEASE_REGISTRY ?= codeclimate
5+
6+
ifndef RELEASE_TAG
7+
override RELEASE_TAG = latest
8+
endif
49

510
NPM_TEST_TARGET ?= test
611
NPM_INTEGRATION_TARGET ?= integration
@@ -48,3 +53,7 @@ yarn.lock: package.json Dockerfile
4853
$(MAKE) image
4954
./bin/yarn install
5055
touch yarn.lock
56+
57+
release:
58+
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-eslint:$(RELEASE_TAG)
59+
docker push $(RELEASE_REGISTRY)/codeclimate-eslint:$(RELEASE_TAG)

0 commit comments

Comments
 (0)