From abe98f716bff7f7bd9543be3f5dfcb492a319a0f Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Tue, 3 Oct 2017 05:02:15 -0500 Subject: [PATCH] run builds for prs without commiting (#1997) --- travis/deploy.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/travis/deploy.sh b/travis/deploy.sh index 08264264e..9b4287294 100644 --- a/travis/deploy.sh +++ b/travis/deploy.sh @@ -8,14 +8,13 @@ if [[ "$TRAVIS_BRANCH" == revert-* ]]; then exit 0 fi -# For PRs, do nothing -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo -e "\e[36m\e[1mBuild triggered for PR #${TRAVIS_PULL_REQUEST} to branch \"${TRAVIS_BRANCH}\" - doing nothing." - exit 0 -fi +DONT_COMMIT=false -# Figure out the source of the build -if [ -n "$TRAVIS_TAG" ]; then +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "\e[36m\e[1mBuild triggered for PR #${TRAVIS_PULL_REQUEST} to branch \"${TRAVIS_BRANCH}\" - not commiting" + SOURCE_TYPE="pr" + DONT_COMMIT=true +elif [ -n "$TRAVIS_TAG" ]; then echo -e "\e[36m\e[1mBuild triggered for tag \"${TRAVIS_TAG}\"." SOURCE=$TRAVIS_TAG SOURCE_TYPE="tag" @@ -35,6 +34,9 @@ fi npm run docs VERSIONED=false npm run webpack +if [ $DONT_COMMIT ]; then + exit 0 +fi # Initialise some useful variables REPO=`git config remote.origin.url` @@ -85,3 +87,4 @@ git config user.name "Travis CI" git config user.email "$COMMIT_AUTHOR_EMAIL" git commit -m "Webpack build for ${SOURCE_TYPE} ${SOURCE}: ${SHA}" || true git push $SSH_REPO $TARGET_BRANCH +