提交jenkins自动化流水线

This commit is contained in:
Home
2026-03-28 21:21:17 +08:00
parent 8d33cb3c34
commit b075b68dbf
Vendored
+19 -7
View File
@@ -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('构建 & 测试') {