File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 1313 - run :
1414 name : Test
1515 command : make test
16+
17+ release_images :
18+ machine :
19+ docker_layer_caching : true
20+ working_directory : ~/codeclimate/codeclimate-sonar-java
21+ steps :
22+ - checkout
23+ - run :
24+ name : Validate owner
25+ command : |
26+ if [ "$CIRCLE_PROJECT_USERNAME" -ne "codeclimate" ]
27+ then
28+ echo "Skipping release for non-codeclimate branches"
29+ circleci step halt
30+ fi
31+ - run : make image
32+ - run : echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
33+ - run :
34+ name : Push image to Dockerhub
35+ command : |
36+ make release RELEASE_TAG="b$CIRCLE_BUILD_NUM"
37+ make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')"
38+ workflows :
39+ version : 2
40+ build_deploy :
41+ jobs :
42+ - build
43+ - release_images :
44+ context : Quality
45+ requires :
46+ - build
47+ filters :
48+ branches :
49+ only : /master|channel\/[\w-]+/
50+
1651notify :
1752 webhooks :
1853 - url : https://cc-slack-proxy.herokuapp.com/circle
Original file line number Diff line number Diff line change 1- .PHONY : image test
1+ .PHONY : image test release
22
33IMAGE_NAME ?= codeclimate/codeclimate-sonar-java
4+ RELEASE_REGISTRY ?= codeclimate
5+
6+ ifndef RELEASE_TAG
7+ override RELEASE_TAG = latest
8+ endif
49
510image :
611 docker build --rm -t $(IMAGE_NAME ) .
712
813test : image
914 docker run --rm -ti -w /usr/src/app -u root $(IMAGE_NAME ) gradle clean test
15+
16+ release :
17+ docker tag $(IMAGE_NAME ) $(RELEASE_REGISTRY ) /codeclimate-sonar-java:$(RELEASE_TAG )
18+ docker push $(RELEASE_REGISTRY ) /codeclimate-sonar-java:$(RELEASE_TAG )
You can’t perform that action at this time.
0 commit comments