Skip to content

Commit

Permalink
QUA-958: Push images to Dockerhub instead of GCR (#379)
Browse files Browse the repository at this point in the history
* Push images to Dockerhub instead of GCR

* change make release image name

* override RELEASE_TAG on empty string
  • Loading branch information
dantevvp authored Mar 10, 2023
1 parent 9c6078b commit a58f543
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -18,15 +18,20 @@ jobs:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run: docker login -u _json_key -p "$GCR_JSON_KEY" us.gcr.io
- run: make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- run:
name: Push image to Dockerhub
command: |
make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')"
workflows:
version: 2
build_deploy:
jobs:
- build_and_test
- release_images:
context: Quality
requires:
- build_and_test
filters:
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.PHONY: image test citest release

IMAGE_NAME ?= codeclimate/codeclimate-duplication
RELEASE_REGISTRY ?= codeclimate

ifndef RELEASE_TAG
override RELEASE_TAG = latest
endif

image:
docker build --rm -t $(IMAGE_NAME) .
@@ -17,7 +22,6 @@ bundle:
--volume $(PWD):/usr/src/app \
$(IMAGE_NAME) -c "bundle $(BUNDLE_ARGS)"

release: image
docker tag $(IMAGE_NAME) \
us.gcr.io/code_climate/codeclimate-duplication:$(RELEASE_TAG)
docker push us.gcr.io/code_climate/codeclimate-duplication:$(RELEASE_TAG)
release:
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-duplication:$(RELEASE_TAG)
docker push $(RELEASE_REGISTRY)/codeclimate-duplication:$(RELEASE_TAG)

0 comments on commit a58f543

Please sign in to comment.