From 40fc9ee9ca866ec8ab1a6894128b1d5bfeefcae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20L=C3=B3pez?= Date: Wed, 2 Nov 2016 12:09:05 +0100 Subject: [PATCH] use TravisCI env vars --- scripts/build.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 248b29a..75d1525 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -11,12 +11,11 @@ if [[ "${FOULKON_DEV}" ]]; then exit 0 fi -branch=$(git rev-parse --abbrev-ref HEAD) -tag=$(git tag --points-at HEAD) +echo "Current branch: <${TRAVIS_BRANCH}>, PR <${TRAVIS_PULL_REQUEST}>, current tag: <${TRAVIS_TAG}>" -if [ "$tag" != "" ]; then - build=$tag -elif [ "$branch" == "master" ]; then +if [ "$TRAVIS_TAG" != "" ]; then + build=$TRAVIS_TAG +elif [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then build="latest" else echo "Not in branch or commit, exiting..."