From 131b0d0df1652164c1128a70b126a53fb57195b1 Mon Sep 17 00:00:00 2001 From: Docker Config Backup Date: Mon, 13 Apr 2026 15:24:52 +0200 Subject: [PATCH] chore: add deploy-tkb.sh Mirrors the rsync workflow I've been running by hand. Patches the production to "Tunely" (local index.html keeps "Tunely-DEV" so dev tabs are distinguishable) and restarts the tkb-plan pm2 process. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --- web/deploy-tkb.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 web/deploy-tkb.sh diff --git a/web/deploy-tkb.sh b/web/deploy-tkb.sh new file mode 100755 index 0000000..b75b5c2 --- /dev/null +++ b/web/deploy-tkb.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Deploy TKB Plán služeb to copelk +set -e + +REMOTE="copelk" +REMOTE_DIR="~/tkb-plan/web" + +echo "Building..." +cd "$(dirname "$0")" +npx vite build + +echo "Syncing to $REMOTE..." +rsync -avz --delete \ + --exclude='node_modules' \ + --exclude='.git' \ + --exclude='saved_schedule.json' \ + --exclude='schedules' \ + --exclude='uploads' \ + ./ "$REMOTE:$REMOTE_DIR/" + +echo "Patching production title (Tunely-DEV → Tunely)..." +ssh $REMOTE "sed -i 's|<title>Tunely-DEV|Tunely|' $REMOTE_DIR/dist/index.html" + +echo "Restarting service on remote..." +ssh $REMOTE "pm2 restart tkb-plan" + +echo "Done! App running on copelk:3090"