From 79e428ff0f7478f4d821ecd0e069e6a264850179 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Sun, 12 Apr 2026 19:48:13 +0200 Subject: [PATCH] script to rebuild pages --- scripts/rebuild.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/rebuild.sh diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh new file mode 100755 index 0000000..c52a34e --- /dev/null +++ b/scripts/rebuild.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -e + +REPO=/opt/bincio-repo.git +DEPLOY=/opt/bincio +DATA=/var/bincio/data + +echo "--- Syncing Python deps ---" +cd $DEPLOY +~/.local/bin/uv sync --extra serve --extra strava --extra garmin + +echo "--- Syncing JS deps ---" +cd $DEPLOY/site +npm install --silent + +echo "--- Building site ---" +cd $DEPLOY +~/.local/bin/uv run bincio render --data-dir $DATA --site-dir $DEPLOY/site + +echo "--- Copying dist to webroot ---" +rsync -a --delete $DEPLOY/site/dist/ /var/www/bincio/ + +echo "--- Restarting API ---" +systemctl restart bincio || echo "WARNING: bincio service restart failed — check journalctl -u bincio" + +echo "--- Done ---" \ No newline at end of file