File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,20 @@ jobs:
26
26
circleci step halt
27
27
fi
28
28
- 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
30
30
- run :
31
- name : Push image to GCR
31
+ name : Push image to Dockerhub
32
32
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\-]+')"
36
35
37
36
workflows :
38
37
version : 2
39
38
build_deploy :
40
39
jobs :
41
40
- build
42
41
- release_images :
42
+ context : Quality
43
43
requires :
44
44
- build
45
45
filters :
Original file line number Diff line number Diff line change 1
- .PHONY : image
1
+ .PHONY : image release
2
2
3
3
IMAGE_NAME ?= codeclimate/codeclimate-phpcodesniffer
4
+ RELEASE_REGISTRY ?= codeclimate
5
+
6
+ ifndef RELEASE_TAG
7
+ override RELEASE_TAG = latest
8
+ endif
4
9
5
10
composer-update :
6
11
docker run \
@@ -12,3 +17,7 @@ composer-update:
12
17
13
18
image :
14
19
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 )
You can’t perform that action at this time.
0 commit comments