new-codigoparallevar/scripts/upload.sh

31 lines
1.0 KiB
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
2023-10-02 22:07:57 +00:00
rm -Rf ../_gen/blog
WATCH_AND_REBUILD=0 python3 blog.py ~/cloud/nextcloud/blog/posts/ ../_gen/blog
2023-10-02 22:22:03 +00:00
rm -Rf ../_gen/static
cp -Rv ../static ../_gen/static
2022-10-17 23:16:14 +00:00
# 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/
2023-10-02 22:07:57 +00:00
rsync -HPaz blog/ --delete-after --exclude='xapian' --exclude='*.sqlite3' root@codigoparallevar.com:/mnt/vols/misc/codigoparallevar/blog/
2022-10-17 23:16:14 +00:00
# Restart API server
ssh root@codigoparallevar.com docker restart notes-api-server