#!/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|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"