Skip to content

Commit

Permalink
Don't run deploy on forks and non-PRs (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebjerring authored Apr 24, 2018
1 parent ef9d7f7 commit c75ec6d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ install:
fi
script:
- | # Deploy PR to staging environment
if [ "${MAKE_DEPLOY_TARGET}" != "" ]; then
- | # Deploy PR to staging environment (only when Travis secrets are available)
if [ "${MAKE_DEPLOY_TARGET}" != "" ] \
&& [ "${TRAVIS_SECURE_ENV_VARS}" != "false" ] \
&& [ "${TRAVIS_PULL_REQUEST_BRANCH}" != "" ];
then
echo "Copying output to ${TEMP_FILE:=$(mktemp)}"
# NOTE: Most gcloud output is stderr, so need to redirect it to stdout.
docker exec -t -u $(id -u $USER):$(id -g $USER) "${DOCKER_INSTANCE}" make "${MAKE_DEPLOY_TARGET}" BRANCH_NAME=${TRAVIS_PULL_REQUEST_BRANCH} 2>&1 | tee ${TEMP_FILE}
Expand Down

0 comments on commit c75ec6d

Please sign in to comment.