Skip to content

Instantly share code, notes, and snippets.

@razor-x
Created May 15, 2016 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razor-x/a76da4b96928986776a966124a078e1d to your computer and use it in GitHub Desktop.
Save razor-x/a76da4b96928986776a966124a078e1d to your computer and use it in GitHub Desktop.
#!/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 'ninja@example.com'
npm run deploy
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment