Skip to content
Snippets Groups Projects
Commit db52abbd authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5907 update jenkinsfile to upload jars from branches

parent 718716e0
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,26 @@ pipeline { ...@@ -40,6 +40,26 @@ pipeline {
} }
} }
} }
stage('Set Version') {
when {
not {
anyOf {
branch 'master'
branch 'release'
}
}
}
steps {
script {
FAILED_STAGE=env.STAGE_NAME
JAR_TAG = getPomVersion().replace("SNAPSHOT", "${env.BRANCH_NAME}-SNAPSHOT")
}
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh "mvn -s $MAVEN_SETTINGS versions:set -DnewVersion=${JAR_TAG} -DprocessAllModules=true"
}
}
}
stage('Build Administration') { stage('Build Administration') {
steps { steps {
...@@ -54,18 +74,13 @@ pipeline { ...@@ -54,18 +74,13 @@ pipeline {
} }
stage('Deploy to Nexus'){ stage('Deploy to Nexus'){
when {
anyOf {
branch 'master'
branch 'release'
}
}
steps { steps {
script { script {
FAILED_STAGE = env.STAGE_NAME FAILED_STAGE = env.STAGE_NAME
} }
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3' sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3'
sh "mvn -s $MAVEN_SETTINGS versions:revert"
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment