一大波改动
这个提交包含在:
父节点
e81bf89697
当前提交
aa20a790a1
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
@ -2,7 +2,6 @@ pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
string(name: 'BRANCH', defaultValue: 'main', description: 'Git 分支名')
|
||||
string(name: 'VERSION', defaultValue: '', description: '发布版本号(留空使用 gradle.properties 中的 PUBLISH_VERSION)')
|
||||
booleanParam(name: 'RUN_TESTS', defaultValue: true, description: '是否运行自动化测试')
|
||||
booleanParam(name: 'PUBLISH', defaultValue: true, description: '是否发布到 Nexus')
|
||||
@ -16,7 +15,12 @@ pipeline {
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: 'main']],
|
||||
extensions: [[$class: 'CleanBeforeCheckout']],
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
script {
|
||||
if (params.VERSION?.trim()) {
|
||||
bat "powershell -Command \"(Get-Content gradle.properties) -replace '^PUBLISH_VERSION=.*', 'PUBLISH_VERSION=${params.VERSION}' | Set-Content gradle.properties\""
|
||||
@ -93,11 +97,8 @@ pipeline {
|
||||
|
||||
stage('Publish to Nexus') {
|
||||
when {
|
||||
allOf {
|
||||
branch 'main'
|
||||
expression { return params.PUBLISH }
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def versionArg = params.VERSION?.trim() ? "-PPUBLISH_VERSION=${params.VERSION}" : ''
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户