deploy preview test

This commit is contained in:
Lorin Werthen 2017-10-14 00:07:12 +02:00
parent 0e89f41b43
commit 8eb1ab3a2d
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
2 changed files with 10 additions and 1 deletions

View file

@ -23,4 +23,5 @@ 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
- ./deploy.sh

8
deploy.sh Executable file
View file

@ -0,0 +1,8 @@
#! /bin/bash
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