Created
April 22, 2016 09:38
-
-
Save rmehner/78f4c50552dbf002e023527d35b20aba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
info() { echo "$0: $1"; } | |
skip() { info "${1}. Skipping build."; exit 0; } | |
[[ "$TRAVIS_PULL_REQUEST" == "false" ]] || { | |
skip "This build was triggered by a pull request" | |
} | |
if [[ "$TRAVIS_BRANCH" == "master" ]]; then | |
STAGE="staging" | |
elif [[ "$TRAVIS_BRANCH" == "production" ]]; then | |
STAGE="production" | |
else | |
skip "Unsupported branch $TRAVIS_BRANCH and/or untagged commit" | |
fi | |
bundle exec cap $STAGE deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment