File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 31
31
32
32
- run :
33
33
name : Run Tests
34
- command : carton exec prove -lv
34
+ command : carton exec prove -lv
35
+
36
+ - setup_remote_docker
37
+
38
+ - run :
39
+ name : Install Docker client
40
+ when : on_success
41
+ command : |
42
+ if [ "${CIRCLE_BRANCH}" == "circle-ci" ]; then
43
+ set -x
44
+ VER="17.03.0-ce"
45
+ curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
46
+ tar -xz -C /tmp -f /tmp/docker-$VER.tgz
47
+ mv /tmp/docker/* /usr/bin
48
+ else
49
+ echo "Not master branch so no docker required"
50
+ fi
51
+
52
+ - run :
53
+ name : Build and Push Docker Image
54
+ when : on_success
55
+ shell : /bin/bash
56
+ command : |
57
+ if [ "${CIRCLE_BRANCH}" == "circle-ci" ]; then
58
+ docker login -u ${DOCKER_LOGIN} -p ${DOCKER_PASSWORD}
59
+ make update push_ci
60
+ else
61
+ echo "Not master branch, So no push to DockerHub"
62
+ fi
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ RELEASE_VERSION ?= latest
10
10
LOCAL_IMAGE := $(NAME ) :$(RELEASE_VERSION )
11
11
REMOTE_IMAGE := $(NAMESPACE ) /$(LOCAL_IMAGE )
12
12
13
+ CIRLE_SHA1 ?= ''
14
+ REMOTE_IMAGE_CI := $(NAMESPACE ) /$(NAME ) :$(CIRCLE_SHA1 )
15
+
13
16
# Environment General Settings
14
17
ENVIRONMENT ?= devel
15
18
SECRETS_URL ?= 'https://www.dropbox.com/s/p9x87ffn19rdr0c/secrets.mk.gpg'
@@ -92,6 +95,10 @@ tag: ## Tag IMAGE_NAME
92
95
push : tag # # Push to the docker registry
93
96
docker push $(REMOTE_IMAGE )
94
97
98
+ push_ci :
99
+ docker tag $(LOCAL_IMAGE ) $(REMOTE_IMAGE_CI )
100
+ docker push $(REMOTE_IMAGE_CI )
101
+
95
102
pull : # # Pull the docker from the Registry
96
103
docker pull $(REMOTE_IMAGE )
97
104
You can’t perform that action at this time.
0 commit comments