Push to docker hub only push build from alxchk/pupy

This commit is contained in:
Oleksii Shevchuk 2018-08-17 07:37:11 +03:00
parent b8116e1399
commit e56bd948de
1 changed files with 6 additions and 2 deletions

View File

@ -29,8 +29,12 @@ script:
- ls -l $TRAVIS_BUILD_DIR/pupy/payload_templates/linux-x86.zip
after_success:
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi`
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- cd $TRAVIS_BUILD_DIR/pupy && docker push alxchk/pupy:$TAG >/dev/null
- |
if [ "$TRAVIS_REPO_SLUG" == "alxchk/pupy" ] && [ -z "$TRAVIS_PULL_REQUEST_SLUG" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS &&
cd $TRAVIS_BUILD_DIR/pupy &&
docker push alxchk/pupy:$TAG >/dev/null;
fi
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}