Reset Jenkins workspaces before build deploy and migration

This commit is contained in:
kdletters
2026-05-01 22:57:00 +08:00
parent 1abec5754e
commit d796e7d491
6 changed files with 13 additions and 3 deletions

View File

@@ -56,6 +56,8 @@ pipeline {
sh """
bash -lc '
set -euo pipefail
# 导出流水线复用固定源码目录时,先清掉本地改动,确保执行的是 Jenkins SCM 检出的脚本。
git reset --hard HEAD
export_dir="${params.OUTPUT_DIRECTORY}"
if [[ -z "\${export_dir}" ]]; then
export_dir="database-exports"