blog.hugopoi.net/deploy.sh

17 lines
446 B
Bash
Raw Permalink Normal View History

2022-11-19 16:33:50 +01:00
#!/bin/bash
2023-12-11 08:45:00 +01:00
set -e
2022-11-19 16:33:50 +01:00
# Build
2022-12-03 17:14:30 +01:00
cd v2
2022-11-19 16:33:50 +01:00
hugo
2022-12-03 17:14:30 +01:00
cd ..
2022-11-19 16:33:50 +01:00
# Backup current deploy
2023-12-11 08:45:00 +01:00
ssh -t home.hugopoi.net sudo yunohost backup create --apps my_webapp
2022-12-03 17:14:30 +01:00
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