From 7c4986879a408afd77c8042d4f5c7c1222ef500b Mon Sep 17 00:00:00 2001 From: dxin Date: Sat, 18 Oct 2025 12:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Elessie=5Fsourcing=5Fagents.gr?= =?UTF-8?q?oovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCM/essie_sourcing_agents.groovy | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 SCM/essie_sourcing_agents.groovy diff --git a/SCM/essie_sourcing_agents.groovy b/SCM/essie_sourcing_agents.groovy new file mode 100644 index 0000000..150286c --- /dev/null +++ b/SCM/essie_sourcing_agents.groovy @@ -0,0 +1,37 @@ +pipeline { + agent any + stages { + stage('拉取镜像') { + steps { + script { + // 从选择的参数中提取标签(如从 "tag→分支:xxx..." 中取前半部分) + def imageTag = params.SELECTED_IMAGE.split(" → ")[0].trim() + def fullImage = "uswccr.ccs.tencentyun.com/lessietest/lessie-sourcing-agents:${imageTag}" + + // 登录仓库并拉取镜像 + withCredentials([usernamePassword( + credentialsId: 'dxin_img_hub_auth', + usernameVariable: 'USERNAME', + passwordVariable: 'PASSWORD' + )]) { + sh """ + echo "${PASSWORD}" | docker login uswccr.ccs.tencentyun.com -u ${USERNAME} --password-stdin + docker pull ${fullImage} + """ + } + } + } + } + stage('部署镜像') { + steps { + script { + def imageTag = params.SELECTED_IMAGE.split(" → ")[0].trim() + def fullImage = "uswccr.ccs.tencentyun.com/lessietest/lessie-sourcing-agents:${imageTag}" + echo "正在部署镜像:${fullImage}" + // 添加你的部署命令(如 docker run、kubectl apply 等) + // sh "docker run -d --name my-app ${fullImage}" + } + } + } + } +} \ No newline at end of file