From 984a06a0981a42fb81f7c84e3cb83e246627437c Mon Sep 17 00:00:00 2001 From: ericwyuan Date: Tue, 1 Sep 2026 14:34:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20deploy/=20=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E6=B2=A1=E8=B7=9F=E7=9D=80=E4=B8=8A=E6=9C=BA=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E5=AE=83=E7=AD=89=E4=BA=8E=E6=B2=A1=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重启跑的是 NAS 上那份 stop.sh / start.sh,而 push.sh 只同步 backend/ 和 client/build/。结果就是:修好 stop.sh 的 pgrep、提交、部署、报成功,远端 照样跑着旧脚本——上一个提交正是这么被架空的。 Co-Authored-By: Claude Opus 5 --- deploy/push.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy/push.sh b/deploy/push.sh index b3ad0e5..a7f25d1 100755 --- a/deploy/push.sh +++ b/deploy/push.sh @@ -62,6 +62,14 @@ $TAR --exclude .venv --exclude .env --exclude __pycache__ \ --exclude '*.db' --exclude tests --exclude .pytest_cache \ -C "$REPO/backend" . | sh_ "tar xzf - -C '$APP/backend'" +# The restart below runs the NAS's own copies of stop.sh / start.sh, so they +# have to travel with the code — otherwise a fix to them lands in git, the +# deploy reports success, and the far side keeps running the old ones. That is +# exactly how the broken pgrep guards survived a deploy that was meant to fix +# them. +echo "==> deploy scripts" +$TAR -C "$REPO/deploy" . | sh_ "tar xzf - -C '$APP/deploy'" + echo "==> static (cleared first, so stale JS chunks do not pile up)" if [ ! -f "$REPO/client/build/index.html" ]; then echo "client/build is missing — run 'npm run build' first" >&2