install_linux.sh: support DEPLOY_BRANCH env var for non-main branch deployment

Usage: sudo DEPLOY_BRANCH=debug-logging bash install_linux.sh
This commit is contained in:
2026-07-08 19:32:39 +08:00
parent 616d30bc08
commit 1dce2bb99d
+6 -2
View File
@@ -14,9 +14,13 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1 exit 1
fi fi
echo ">>> 拉取最新代码(强制覆盖本地修改)..." # 部署分支(默认 main,调试时可改为其他分支如 debug-logging
DEPLOY_BRANCH="${DEPLOY_BRANCH:-main}"
echo ">>> 拉取最新代码(分支: $DEPLOY_BRANCH,强制覆盖本地修改)..."
git fetch origin git fetch origin
git reset --hard origin/main git checkout "$DEPLOY_BRANCH"
git reset --hard "origin/$DEPLOY_BRANCH"
echo ">>> 安装前端依赖并构建..." echo ">>> 安装前端依赖并构建..."
cd frontend cd frontend