From 0fd1fb7d57e02d2351c7227c93e651cb2a1e089e Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 21 Feb 2019 21:44:47 +0300 Subject: [PATCH] Don't build docker image when running Travis job on some another repo (#2718) --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b2bb2043f6d0..01fc4721adc9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,8 @@ before_script: # Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout # See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed. - python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' + # Build docker image only for develop branch of the main repo + - if [ "$TRAVIS_REPO_SLUG" != "dashpay/dash" -o "$TRAVIS_BRANCH" != "develop" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then export DOCKER_BUILD="false"; echo DOCKER_BUILD=$DOCKER_BUILD; fi script: - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1` # Our scripts try to be Travis agnostic @@ -79,4 +81,4 @@ after_script: - echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT_LOG after_success: - - if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_BRANCH" = "develop" -a "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./docker/push-docker.sh; fi + - if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./docker/push-docker.sh; fi