ci: 修改Jenkinsfile,去掉不用的build_parent

This commit is contained in:
CaptainB 2023-01-29 13:45:39 +08:00
parent 86894b28ab
commit cdab43c0d5
1 changed files with 3 additions and 32 deletions

35
Jenkinsfile vendored
View File

@ -17,7 +17,6 @@ pipeline {
script { script {
REVISION = "" REVISION = ""
BUILD_SDK = false BUILD_SDK = false
BUILD_PARENT = false
if (env.BRANCH_NAME.startsWith("v") ) { if (env.BRANCH_NAME.startsWith("v") ) {
REVISION = env.BRANCH_NAME.substring(1) REVISION = env.BRANCH_NAME.substring(1)
} else { } else {
@ -26,30 +25,12 @@ pipeline {
if (params.buildSdk) { if (params.buildSdk) {
BUILD_SDK = true BUILD_SDK = true
} }
if (params.buildParent) {
BUILD_PARENT = true
}
if (params.frontendLink != null && !params.frontendLink.equals("")) { if (params.frontendLink != null && !params.frontendLink.equals("")) {
env.FRONTEND_LINK = params.frontendLink env.FRONTEND_LINK = params.frontendLink
} }
env.REVISION = "${REVISION}" env.REVISION = "${REVISION}"
env.BUILD_SDK = "${BUILD_SDK}" env.BUILD_SDK = "${BUILD_SDK}"
env.BUILD_PARENT = "${BUILD_PARENT}" echo "REVISION=${REVISION}, BUILD_SDK=${BUILD_SDK}"
echo "REVISION=${REVISION}, BUILD_SDK=${BUILD_SDK}, BUILD_PARENT=${BUILD_PARENT}"
}
}
}
stage('POM') {
when { environment name: 'BUILD_PARENT', value: 'true' }
steps {
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
sh '''#!/bin/bash -xe
export JAVA_HOME=/opt/jdk-17
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
java -version
./mvnw install -N -Drevision=${REVISION} --settings ./settings.xml
'''
} }
} }
} }
@ -74,12 +55,7 @@ pipeline {
} }
} }
stage('Build/Test') { stage('Build/Test') {
when { when { environment name: 'BUILD_SDK', value: 'false' }
allOf {
environment name: 'BUILD_SDK', value: 'false';
environment name: 'BUILD_PARENT', value: 'false'
}
}
steps { steps {
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) { configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
sh '''#!/bin/bash -xe sh '''#!/bin/bash -xe
@ -107,12 +83,7 @@ pipeline {
} }
} }
stage('Docker build & push') { stage('Docker build & push') {
when { when { environment name: 'BUILD_SDK', value: 'false' }
allOf {
environment name: 'BUILD_SDK', value: 'false';
environment name: 'BUILD_PARENT', value: 'false'
}
}
steps { steps {
script { script {
for (int i=0; i<10; i++) { for (int i=0; i<10; i++) {