Skip to content

Commit 3589cd8

Browse files
authored
QUA-958: Push images to Dockerhub instead of GCR (#97)
* Push images to Dockerhub instead of GCR * override RELEASE_TAG on empty string * Force cc analysis
1 parent bb06af6 commit 3589cd8

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

‎.circleci/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ jobs:
2626
circleci step halt
2727
fi
2828
- run: make image
29-
- run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io
29+
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
3030
- run:
31-
name: Push image to GCR
31+
name: Push image to Dockerhub
3232
command: |
33-
docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
34-
us.gcr.io/code-climate/codeclimate-phpcodesniffer:b$CIRCLE_BUILD_NUM
35-
docker push us.gcr.io/code-climate/codeclimate-phpcodesniffer:b$CIRCLE_BUILD_NUM
33+
make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
34+
make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')"
3635
3736
workflows:
3837
version: 2
3938
build_deploy:
4039
jobs:
4140
- build
4241
- release_images:
42+
context: Quality
4343
requires:
4444
- build
4545
filters:

‎Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
.PHONY: image
1+
.PHONY: image release
22

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

510
composer-update:
611
docker run \
@@ -12,3 +17,7 @@ composer-update:
1217

1318
image:
1419
docker build --rm -t $(IMAGE_NAME) .
20+
21+
release:
22+
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-phpcodesniffer:$(RELEASE_TAG)
23+
docker push $(RELEASE_REGISTRY)/codeclimate-phpcodesniffer:$(RELEASE_TAG)

0 commit comments

Comments
 (0)