Merge pull request #199 from ZeusWPI/pr-preview
[Don't Merge] Preview Test
This commit is contained in:
commit
6044525f28
2 changed files with 18 additions and 1 deletions
|
@ -7,6 +7,10 @@ cache:
|
|||
- output
|
||||
- tmp
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
rvm:
|
||||
- 2.3.1
|
||||
notifications:
|
||||
|
@ -23,4 +27,6 @@ script:
|
|||
after_success:
|
||||
- mv deploy_key ~/.ssh/id_rsa
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- '[[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]] && bundle exec nanoc --env=prod deploy public'
|
||||
- chmod +x ./deploy.sh
|
||||
- echo -e "Host $TRAVIS_PULL_REQUEST.zeus.werthen.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
- ./deploy.sh
|
||||
|
|
11
deploy.sh
Executable file
11
deploy.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#! /bin/bash
|
||||
echo "Pull Request: $TRAVIS_PULL_REQUEST"
|
||||
echo "Branch: $TRAVIS_BRANCH"
|
||||
|
||||
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
|
||||
if [[ $TRAVIS_BRANCH == "master" ]]; then
|
||||
bundle exec nanoc --env=prod deploy public
|
||||
fi
|
||||
else
|
||||
rsync -aglpPrtvz --delete output/ "deploy@$TRAVIS_PULL_REQUEST.zeus.werthen.com:/var/www/html/$TRAVIS_PULL_REQUEST/"
|
||||
fi
|
Loading…
Reference in a new issue