From a1885daa9a5ff0706bbff0f7227b8d9b93b12405 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 1 Oct 2016 14:28:25 +0800 Subject: [PATCH] deploy image from tag event. Signed-off-by: Bo-Yi Wu --- .travis.yml | 10 ++++++++-- Makefile | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2dbf9b..22513d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,14 @@ script: -service=travis-ci -repotoken=$COVERALLS_TOKEN after_success: + - bash <(curl -s https://codecov.io/bash) -f .cover/coverage.txt + # deploy from master - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_GO_VERSION" == "1.7.1" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; - make deploy tag=latest; + make docker_deploy tag=latest; + fi + # deploy from tag + - if [ "$TRAVIS_GO_VERSION" == "1.7.1" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then + docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; + make docker_deploy tag=$TRAVIS_TAG; fi - - bash <(curl -s https://codecov.io/bash) -f .cover/coverage.txt diff --git a/Makefile b/Makefile index bb6e3f0..ef12642 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ docker_build: clean docker_production: docker build --rm -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist . -deploy: docker_build docker_production +docker_deploy: docker_build docker_production ifeq ($(tag),) @echo "Usage: make $@ tag=" @exit 1