From e48c19a0990cf857b5981d11b8603a034d83a18f Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Thu, 29 Oct 2020 10:26:33 -0500 Subject: [PATCH] #1388 - Properly parse new version format. --- Jenkinsfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 557589ea..d5fdedaa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -137,11 +137,13 @@ pipeline { returnStdout: true ).trim() - RELEASE_TYPE = 'milestone' // .RC? or .M? + RELEASE_TYPE = 'snapshot' - if (PROJECT_VERSION.endsWith('SNAPSHOT')) { + if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) { + RELEASE_TYPE = "milestone" + } else if (PROJECT_VERSION.endsWith('SNAPSHOT')) { RELEASE_TYPE = 'snapshot' - } else if (PROJECT_VERSION.endsWith('RELEASE')) { + } else if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { RELEASE_TYPE = 'release' } @@ -224,7 +226,7 @@ pipeline { returnStdout: true ).trim() - if (PROJECT_VERSION.endsWith('RELEASE')) { + if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { unstash name: 'build_info' sh "ci/promote-to-bintray.sh" } else { @@ -262,7 +264,7 @@ pipeline { returnStdout: true ).trim() - if (PROJECT_VERSION.endsWith('RELEASE')) { + if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { unstash name: 'build_info' sh "ci/sync-to-maven-central.sh" } else {