This commit is contained in:
2026-08-04 12:50:20 +05:00
parent 4194cef934
commit 363127fe9e
3350 changed files with 1284220 additions and 1 deletions

23
backend/scripts/deploy.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
# Build, push to the self-hosted registry, and trigger Watchtower.
#
# Run this ON THE VPS (registry is bound to 127.0.0.1, so it's only
# reachable locally). To run it from your laptop instead, first open a
# tunnel: ssh -L 5000:localhost:5000 -L 8080:localhost:8080 user@vps
set -e
IMAGE=localhost:5000/bankline:latest
WATCHTOWER_URL=http://localhost:8080/v1/update
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
docker build -t "$IMAGE" -f "$SCRIPT_DIR/Dockerfile" "$SCRIPT_DIR"
docker push "$IMAGE"
if [ -z "$WATCHTOWER_TOKEN" ]; then
echo "WATCHTOWER_TOKEN not set — skipping trigger; Watchtower will pick it up on its next poll." >&2
exit 0
fi
curl -sf -H "Authorization: Bearer $WATCHTOWER_TOKEN" "$WATCHTOWER_URL"
echo "Watchtower update triggered."