Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

QUA-958: Push images to Dockerhub instead of GCR #379

Merged
merged 3 commits into from
Mar 10, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.PHONY: image test citest release

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

image:
docker build --rm -t $(IMAGE_NAME) .
@@ -17,7 +19,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)