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