new-codigoparallevar/scripts/upload.sh

24 lines
751 B
Bash
Raw Normal View History

2022-10-17 23:16:14 +00:00
#!/usr/bin/env bash
set -eu
cd "$(dirname "$0")/.."
# Upload homepage
cd static
scp homepage.html root@codigoparallevar.com:/mnt/vols/misc/codigoparallevar/index.html
# Build notes
cd ../scripts
rm -Rf ../_gen/notes
2022-10-17 23:16:14 +00:00
WATCH_AND_REBUILD=0 python3 generate.py ~/.logs/brain ../_gen/notes
# Upload notes
cd ../_gen
rsync -HPaz static/ --delete-after --exclude='*.html' root@codigoparallevar.com:/mnt/vols/misc/codigoparallevar/static/
rsync -HPaz notes/ --delete-after --exclude='xapian' --exclude='*.sqlite3' root@codigoparallevar.com:/mnt/vols/misc/codigoparallevar/notes/
rsync -HPaz notes/db.sqlite3 root@codigoparallevar.com:/mnt/vols/misc/codigoparallevar-api/
# Restart API server
ssh root@codigoparallevar.com docker restart notes-api-server