blog.hugopoi.net/deploy.sh

17 lines
446 B
Bash
Executable File

#!/bin/bash
set -e
# Build
cd v2
hugo
cd ..
# Backup current deploy
ssh -t home.hugopoi.net sudo yunohost backup create --apps my_webapp
echo "$1"
if [[ "$1" == "--full" ]]; then
echo "Deploy full legacy and new blog"
rsync -rlgoD --checksum --verbose www/ home.hugopoi.net:/var/www/my_webapp/www/
else
echo "Deploy only the new hugo blog"
rsync -rlgoD --verbose --checksum --delete www/v2/ home.hugopoi.net:/var/www/my_webapp/www/v2/
fi