#!/bin/bash # Auto-deploy script for smeta-web # Called by Gitea webhook or manually: bash scripts/deploy.sh set -e cd /home/mcp-user/smeta-web echo "[$(date)] Deploy started" # Pull latest git pull origin main 2>&1 || true # Install deps if changed pip3 install -q -r requirements.txt 2>&1 || true # Restart service sudo systemctl restart smeta-web sleep 3 # Verify service is running if systemctl is-active --quiet smeta-web; then echo "[$(date)] Service active" else echo "[$(date)] ERROR: Service not active!" exit 1 fi # Quick smoke test (5 questions) export $(grep SESSION_SECRET .env) RESULT=$(python3 tests/test_chat_quality.py --quick 2>&1 | grep "Passed:") echo "[$(date)] Test: $RESULT" echo "[$(date)] Deploy complete"