From af6c8fa4a4ecf6a26d1e22e7c8d3c9bb85c0683a Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Fri, 13 Jan 2017 20:39:03 -0500 Subject: [PATCH] Make Travis builds skip revert branches --- deploy/deploy.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 0724f03e5..48b36d30d 100644 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -16,9 +16,15 @@ function build { VERSIONED=false npm run web-dist } -# Only run tests for PRs +# For revert branches, do nothing +if [[ "$TRAVIS_BRANCH" == revert-* ]] + echo -e "\e[36m\e[1mBuild triggered for reversion branch \"$TRAVIS_BRANCH\" - doing nothing." + exit 0 +fi + +# For PRs, only run tests if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo -e "\e[36m\e[1mBuild triggered for PR #$TRAVIS_PULL_REQUEST to branch $TRAVIS_BRANCH - only running tests." + echo -e "\e[36m\e[1mBuild triggered for PR #$TRAVIS_PULL_REQUEST to branch \"$TRAVIS_BRANCH\" - only running tests." tests fi @@ -31,7 +37,7 @@ else SOURCE=$TRAVIS_BRANCH fi -# Only run tests for Node versions other than 6 +# For Node != 6, only run tests if [ "$TRAVIS_NODE_VERSION" != "6" ]; then echo -e "\e[36m\e[1mBuild triggered with Node v$TRAVIS_NODE_VERSION - only running tests." tests