Created
May 15, 2016 22:37
-
-
Save razor-x/a76da4b96928986776a966124a078e1d 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
#!/bin/bash | |
set -e | |
set -u | |
if [ ! "${TRAVIS:-}" = 'true' ]; then | |
echo 'This is not running on Travis CI. Exiting!' | |
exit 1 | |
fi | |
if [ ! "${TRAVIS_PULL_REQUEST:-}" = 'false' ]; then | |
echo 'Skipping deploy step for pull request.' | |
exit | |
fi | |
if [ -z "${SOURCE_BRANCH:-}" ]; then | |
echo 'Skipping deploy: SOURCE_BRANCH not set.' | |
exit | |
fi | |
if [ ! "${TRAVIS_BRANCH:-}" = ${SOURCE_BRANCH} ]; then | |
echo 'Skipping deploy since this is not the SOURCE_BRANCH.' | |
exit | |
fi | |
echo 'Starting deploy.' | |
echo | |
set -v | |
openssl aes-256-cbc \ | |
# TODO: Remove this line and replace the two below with your unique values. | |
-K $encrypted_000000000000_key \ | |
-iv $encrypted_000000000000_iv \ | |
-in .travis/deploy.key.enc \ | |
-out .travis/deploy.key -d | |
eval "$(ssh-agent -s)" | |
chmod 600 .travis/deploy.key | |
ssh-add .travis/deploy.key | |
git config --global user.name 'Ninja Dev' | |
git config --global user.email '[email protected]' | |
npm run deploy | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment