Skip to content

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

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,20 +26,20 @@ jobs:
circleci step halt
fi
- run: make image
- run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- run:
name: Push image to GCR
name: Push image to Dockerhub
command: |
docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
us.gcr.io/code-climate/codeclimate-phpcodesniffer:b$CIRCLE_BUILD_NUM
docker push us.gcr.io/code-climate/codeclimate-phpcodesniffer:b$CIRCLE_BUILD_NUM
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
- release_images:
context: Quality
requires:
- build
filters:
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
.PHONY: image
.PHONY: image release

IMAGE_NAME ?= codeclimate/codeclimate-phpcodesniffer
RELEASE_REGISTRY ?= codeclimate

ifndef RELEASE_TAG
override RELEASE_TAG = latest
endif

composer-update:
docker run \
Expand All@@ -12,3 +17,7 @@ composer-update:

image:
docker build --rm -t $(IMAGE_NAME) .

release:
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-phpcodesniffer:$(RELEASE_TAG)
docker push $(RELEASE_REGISTRY)/codeclimate-phpcodesniffer:$(RELEASE_TAG)