From e5825e49aa805eea52312bd87b171ac5c2ee92cc Mon Sep 17 00:00:00 2001 From: Dante Ventieri Date: Mon, 13 Feb 2023 11:42:04 -0300 Subject: [PATCH 1/3] Push images to Dockerhub instead of GCR --- .circleci/config.yml | 10 +++++----- Makefile | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 32bebfd..67b73cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,13 +26,12 @@ 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 @@ -40,6 +39,7 @@ workflows: jobs: - build - release_images: + context: Quality requires: - build filters: diff --git a/Makefile b/Makefile index 4057391..d5c456a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ -.PHONY: image +.PHONY: image release IMAGE_NAME ?= codeclimate/codeclimate-phpcodesniffer +RELEASE_REGISTRY ?= codeclimate +RELEASE_TAG ?= latest composer-update: docker run \ @@ -12,3 +14,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) From a387aa030e06461b4576944233ecf3893cfccadb Mon Sep 17 00:00:00 2001 From: Dante Ventieri Date: Mon, 13 Feb 2023 12:52:22 -0300 Subject: [PATCH 2/3] override RELEASE_TAG on empty string --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d5c456a..9c2916c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,10 @@ IMAGE_NAME ?= codeclimate/codeclimate-phpcodesniffer RELEASE_REGISTRY ?= codeclimate -RELEASE_TAG ?= latest + +ifndef RELEASE_TAG +override RELEASE_TAG = latest +endif composer-update: docker run \ From a6b042d2a78fd4a84c7a6da5160d1db0bcdd803b Mon Sep 17 00:00:00 2001 From: Dante Ventieri Date: Fri, 10 Mar 2023 15:10:25 -0300 Subject: [PATCH 3/3] Force cc analysis