Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c9e71a5

Browse files
committed
Push images to Dockerhub instead of GCR
1 parent 90761f0 commit c9e71a5

File tree

3 files changed

+62
-35
lines changed

3 files changed

+62
-35
lines changed

.circleci/config.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2.1
2+
3+
jobs:
4+
build:
5+
machine:
6+
docker_layer_caching: true
7+
working_directory: ~/codeclimate/codeclimate-csslint
8+
steps:
9+
- checkout
10+
- run:
11+
name: Build
12+
command: make image
13+
- run:
14+
name: Test
15+
command: make test
16+
17+
release_images:
18+
machine:
19+
docker_layer_caching: true
20+
working_directory: ~/codeclimate/codeclimate-csslint
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+
51+
notify:
52+
webhooks:
53+
- url: https://cc-slack-proxy.herokuapp.com/circle

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
.PHONY: test
1+
.PHONY: image test release
2+
3+
IMAGE_NAME ?= codeclimate/codeclimate-csslint
4+
RELEASE_REGISTRY ?= codeclimate
5+
RELEASE_TAG ?= latest
26

37
image:
48
docker build -t codeclimate/codeclimate-csslint .
59

610
test: image
711
docker run --rm codeclimate/codeclimate-csslint sh -c "cd /usr/src/app && npm run test"
12+
13+
release:
14+
docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-csslint:$(RELEASE_TAG)
15+
docker push $(RELEASE_REGISTRY)/codeclimate-csslint:$(RELEASE_TAG)

circle.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)