From b075b68dbfb7d2fe3ef0987b3053b0bc5f2ddb2c Mon Sep 17 00:00:00 2001 From: Home Date: Sat, 28 Mar 2026 21:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4jenkins=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=81=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eb8e1c09..8eec757f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,18 +8,30 @@ pipeline { stages { stage('打印环境变量') { steps { - echo "当前分支:${env.GIT_BRANCH}" - echo "使用的凭据ID:${env.GIT_CREDS}" + echo "使用的凭据ID:${env.BRANCH_NAME}" } } - stage('代码拉取') { + stage('清理旧构建') { steps { - git url: 'https://git.home.tymas.cn:8000/tianyan/tra-app.git', - branch: env.GIT_BRANCH, - credentialsId: env.GIT_CREDS + sh ''' + # 清理 uniapp 上次打包产物 + rm -rf dist/ + + # 清理安卓构建缓存 + rm -rf android/simpleDemo/build/ + ''' + } + } + stage('安装依赖') { + steps { + sh 'npm install --registry=https://registry.npmmirror.com' + } + } + stage('打包uniapp') { + steps { + sh 'npm run build:app-plus:${env.BRANCH_NAME}' } } - // // stage('构建 & 测试') {