chore: add server update script
This commit is contained in:
1 parent
0608b84664
commit
4f027a3728
1 file changed
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_DIR="${APP_DIR:-/opt/speaking-practice}"
|
||||
SERVICE_NAME="${SERVICE_NAME:-speaking-practice}"
|
||||
BRANCH_NAME="${BRANCH_NAME:-feature/deepseek-subtitle-ai}"
|
||||
PYTHON_BIN="${PYTHON_BIN:-$APP_DIR/.venv/bin/python}"
|
||||
|
||||
echo "==> Updating Speaking Lab"
|
||||
echo "App directory: $APP_DIR"
|
||||
echo "Branch: $BRANCH_NAME"
|
||||
echo "Service: $SERVICE_NAME"
|
||||
echo
|
||||
|
||||
cd "$APP_DIR"
|
||||
|
||||
echo "==> Fetching latest code"
|
||||
git fetch origin
|
||||
git checkout "$BRANCH_NAME"
|
||||
git pull --ff-only origin "$BRANCH_NAME"
|
||||
|
||||
echo
|
||||
echo "==> Checking Python files"
|
||||
"$PYTHON_BIN" -m py_compile \
|
||||
backend/main.py \
|
||||
backend/db.py \
|
||||
backend/ai_config.py \
|
||||
backend/deepseek_client.py \
|
||||
backend/local_whisper.py \
|
||||
backend/subtitle_ai.py \
|
||||
backend/subtitle_tools.py
|
||||
|
||||
echo
|
||||
echo "==> Restarting service"
|
||||
systemctl restart "$SERVICE_NAME"
|
||||
|
||||
echo
|
||||
echo "==> Service status"
|
||||
systemctl status "$SERVICE_NAME" --no-pager -l
|
||||
|
||||
echo
|
||||
echo "Update complete."
|
||||
Reference in new issue
Block a user