Files
Trading_Studio/server-update.sh
T

14 lines
510 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 服务器快速更新(强制与远端同步,忽略 CRLF 等幽灵改动)
# 用法: bash server-update.sh
set -euo pipefail
cd "$(dirname "$0")"
echo "[INFO] 拉取远端..."
git fetch origin main
echo "[INFO] 强制同步到 origin/main(本地 config.py 等改动将被覆盖,请用 .env 配置 Ollama"
git reset --hard origin/main
echo "[INFO] 重启 PM2..."
pm2 restart trading_studio
pm2 status
echo "[OK] 更新完成。Ollama 地址请编辑 .env(见 .env.example"