Files
PlantAI-rag-new/deploy/vite_restart.sh
T
jerryandClaude Fable 5 1e94de7464 PlantAI-rag-new 首次提交:文献知识工作台
- BFF 薄适配层(FastAPI,8090):QA 代理/SSE 中继/Neo4j 直连/抽取代理/会话持久化
- Vue3 前端:五相位检索流水线、文献来源与证据链、知识图谱、提取任务四 tab
- 四档响应式(桌面/笔记本/平板/手机)、深浅主题
- 81 个 FR 全部实现,测试追溯矩阵 81/81,后端 121 测/前端 156 测
- 真实凭据已脱敏,运行时配置在 backend/.env(不入 git)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 20:47:52 +08:00

28 lines
1.1 KiB
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.
#!/bin/bash
# deploy/vite_restart.sh —— 远端 Vite dev 重启(PM 使用,在远端执行)
# 用法:ssh 100.109.52.26 'bash ~/5090/teamWorkspace/zh/PlantAI-rag-new/deploy/vite_restart.sh [8099|8090]'
# 参数:可选 VITE_BFF_TARGET(默认 8090 = 真实 BFF;传 mock 用 8099)
# 要点:与 bff_restart.sh 同模式——setsid 脱离 SSH、[v]ite 正则防自匹配、日志落盘。
set -uo pipefail
ROOT="/home/xzq/5090/teamWorkspace/zh/PlantAI-rag-new"
TARGET="${1:-8090}"
# 杀旧进程。注意:本脚本名含 "vite"(vite_restart.sh),pkill "[v]ite" 会自匹配杀掉本脚本!
# 用 vite 真实二进制路径做模式(脚本命令行不含 node_modules/.bin)。
pkill -f "node_modules/.bin/[v]ite" 2>/dev/null
sleep 2
cd "$ROOT/frontend"
VITE_BFF_TARGET="http://127.0.0.1:${TARGET}" \
setsid npm run dev > /tmp/plantai-vite.log 2>&1 < /dev/null &
disown
sleep 6
if ss -tln | grep -q ":5180 "; then
echo "VITE UP (127.0.0.1:5180 → ${TARGET})"
else
echo "VITE FAIL —— 日志尾部:"
tail -15 /tmp/plantai-vite.log
exit 1
fi