File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 3131
3232 - run :
3333 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
1010LOCAL_IMAGE := $(NAME ) :$(RELEASE_VERSION )
1111REMOTE_IMAGE := $(NAMESPACE ) /$(LOCAL_IMAGE )
1212
13+ CIRLE_SHA1 ?= ''
14+ REMOTE_IMAGE_CI := $(NAMESPACE ) /$(NAME ) :$(CIRCLE_SHA1 )
15+
1316# Environment General Settings
1417ENVIRONMENT ?= devel
1518SECRETS_URL ?= 'https://www.dropbox.com/s/p9x87ffn19rdr0c/secrets.mk.gpg'
@@ -92,6 +95,10 @@ tag: ## Tag IMAGE_NAME
9295push : tag # # Push to the docker registry
9396 docker push $(REMOTE_IMAGE )
9497
98+ push_ci :
99+ docker tag $(LOCAL_IMAGE ) $(REMOTE_IMAGE_CI )
100+ docker push $(REMOTE_IMAGE_CI )
101+
95102pull : # # Pull the docker from the Registry
96103 docker pull $(REMOTE_IMAGE )
97104
You can’t perform that action at this time.
0 commit comments