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

@@ -115,6 +115,8 @@ pipeline {
sh """
bash -lc '
set -euo pipefail
# 部署流水线也先清回上游工作区的当前提交,避免复用目录中的本地改动影响部署脚本或产物选择。
git reset --hard HEAD
test -d "build/${params.BUILD_VERSION}"
deploy_script="${env.DEPLOY_SCRIPT_PATH}"
chmod +x "\${deploy_script}"