From 805ef3900bf1b895b914d2ef060ac9cf8a0c6450 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 15 May 2026 23:56:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Jenkins=20checkout=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20BRANCH=20=E5=8F=82=E6=95=B0=E8=80=8C=E9=9D=9E=20scm=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit checkout scm 忽略 BRANCH 参数,使用 Jenkins 任务配置的 SCM 分支。 改为显式 checkout 并引用 params.BRANCH,确保构建最新代码。 Co-Authored-By: Claude Opus 4.7 --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ccff036..36d5d1f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,13 @@ pipeline { stages { stage('Checkout') { - steps { checkout scm } + steps { + checkout([$class: 'GitSCM', + branches: [[name: "*/${params.BRANCH}"]], + extensions: [], + userRemoteConfigs: scm.userRemoteConfigs + ]) + } } stage('Docker Build & Push') {