From 5c8923200460ce3686f9c24b5e743805b887e01d Mon Sep 17 00:00:00 2001 From: lxh2875931338 Date: Wed, 29 Jul 2026 23:28:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=86=E9=83=A8=E7=BD=B2=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index d796bcb..cbf1f6b 100644 --- a/deploy.sh +++ b/deploy.sh @@ -477,7 +477,9 @@ do_deploy() { # ----- 事务前钩子:备份数据库(仅降级时备份) ----- BACKUP_DIR="" - if [ -n "$CURRENT_VERSION" ] && [ "$CURRENT_VERSION" != "0.0.0-dev" ]; then + + # 如果是首次部署,跳过版本比对(因为版本文件不存在) + if [ -n "$CURRENT_VERSION" ] && [ "$CURRENT_VERSION" != "0.0.0-dev" ] && [ "$CURRENT_VERSION" != "(首次部署)" ]; then compare_version "$CURRENT_VERSION" "$TARGET_VERSION" COMPARE_RESULT=$? if [ $COMPARE_RESULT -eq 2 ]; then @@ -508,6 +510,8 @@ do_deploy() { print_warn "部署目录不存在,跳过备份" fi fi + else + print_info "首次部署,跳过版本比对" fi # ----- 安装必要工具(必须在拉取代码之前!)-----