From 5bbbafa0c090768ab679709283e9392aa003031c Mon Sep 17 00:00:00 2001 From: jiangh277 Date: Fri, 26 Dec 2025 21:08:00 +0800 Subject: [PATCH] jenkins support --- Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2f16085..dcf5398 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,25 +25,25 @@ pipeline { stages { stage('Checkout') { steps { + checkout scm script { - if (params.GIT_COMMIT) { - checkout scm - sh "git reset --hard ${params.GIT_COMMIT}" - } else { - checkout scm - } + echo "当前分支: ${params.BRANCH_NAME}" + } + } + } + stage('Build timeline-frontend dist') { + steps { + script { + // 确保先执行前端构建命令 + sh 'npm install' + sh 'npm run build' // 这会生成 dist 目录 } - echo "当前构建的 Git Commit: ${env.GIT_COMMIT}" } } stage('Build Docker Image') { steps { script { - // 确保先执行前端构建命令 - sh 'npm install' - sh 'npm run build' // 这会生成 dist 目录 - def imageTag = "${BUILD_NUMBER}-${env.GIT_COMMIT.take(7)}" env.IMAGE_TAG = imageTag sh """