blog.hugopoi.net/deploy.sh

16 lines
436 B
Bash
Raw Normal View History

2022-11-19 16:33:50 +01:00
#!/bin/bash
# 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
ssh 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