Fix empty TRAVIS_COMMIT_RANGE for one-commit-branch builds in Travis (#3299)

This commit is contained in:
UdjinM6 2020-01-24 19:59:06 +03:00 committed by GitHub
parent 546e69f1af
commit 39b17fd5a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,6 +114,8 @@ before_cache:
- docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz - docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz
install: install:
# Fix annoying Travis bug: a branch with a single commit has an empty TRAVIS_COMMIT_RANGE sometimes
- if [ -z "$TRAVIS_COMMIT_RANGE" ]; then export TRAVIS_COMMIT_RANGE="HEAD~..HEAD"; fi
# Our scripts try to be Travis agnostic # Our scripts try to be Travis agnostic
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST" - export PULL_REQUEST="$TRAVIS_PULL_REQUEST"
- export COMMIT_RANGE="$TRAVIS_COMMIT_RANGE" - export COMMIT_RANGE="$TRAVIS_COMMIT_RANGE"