Skip to content

Instantly share code, notes, and snippets.

@rmehner
Created April 22, 2016 09:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmehner/78f4c50552dbf002e023527d35b20aba to your computer and use it in GitHub Desktop.
Save rmehner/78f4c50552dbf002e023527d35b20aba to your computer and use it in GitHub Desktop.
#!/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