deploy image from tag event.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-10-01 14:28:25 +08:00
parent b744208a29
commit a1885daa9a
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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=<tag>"
@exit 1