diff --git a/scripts/db_snapshot_import.sh b/scripts/db_snapshot_import.sh index f6ecfa7..ed6e608 100755 --- a/scripts/db_snapshot_import.sh +++ b/scripts/db_snapshot_import.sh @@ -54,9 +54,11 @@ if [[ "$DB_DATABASE" == "" || "$DB_USERNAME" == "" ]]; then exit 24 fi +# 数据仓工作区:固定目录,但每次都会强制将 remote 指向当前 DATA_REPO_SSH,避免曾经 clone 过其它仓(如 .wiki.git)导致拉错。 WORK_DIR="/tmp/saasshop-data-repo" if [[ -d "$WORK_DIR/.git" ]]; then echo "[data-repo] updating existing clone: $WORK_DIR" + git -C "$WORK_DIR" remote set-url origin "$DATA_REPO_SSH" git -C "$WORK_DIR" fetch origin git -C "$WORK_DIR" checkout main || git -C "$WORK_DIR" checkout -b main git -C "$WORK_DIR" pull --rebase origin main || true diff --git a/scripts/db_snapshot_publish.sh b/scripts/db_snapshot_publish.sh index 84d9e30..9ac0ac4 100755 --- a/scripts/db_snapshot_publish.sh +++ b/scripts/db_snapshot_publish.sh @@ -119,9 +119,11 @@ cat > "$MANIFEST" <