2015-03-26 12:48:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source=public/
|
|
|
|
target=apps@spock.ariejan.net:/home/apps/sites/ariejan.net
|
|
|
|
|
2015-04-07 13:53:35 +00:00
|
|
|
if [ ! `git symbolic-ref HEAD | grep -q "refs/heads/master"` ] ; then
|
|
|
|
echo "You are not on the 'master' branch. Not deploying."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2015-03-26 12:48:12 +00:00
|
|
|
if [ -d ./public ] ; then
|
|
|
|
echo "-- Pruning current static files from ./${source}"
|
|
|
|
rm -rf ./${source}
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-- Generating website to ./${source}"
|
|
|
|
hugo
|
|
|
|
|
|
|
|
echo "-- Uploading using rsync to ${target}"
|
|
|
|
rsync -aqz --delete-after --no-progress ${source} -e ssh ${target}
|