Fine tune looking up current version.

This commit is contained in:
Greg L. Turnquist
2023-09-18 12:20:39 -05:00
parent 867ed7081d
commit 91853706dc
3 changed files with 10 additions and 10 deletions

View File

@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip

5
Jenkinsfile vendored
View File

@@ -159,12 +159,15 @@ pipeline {
steps {
script {
docker.image("${p['docker.java.build.image-proxy']}").inside(p['docker.java.inside.basic']) {
PROJECT_VERSION = sh(
script: "ci/version.sh",
returnStdout: true
).trim()
echo "Releasing Spring WS ${PROJECT_VERSION}..."
if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) {
RELEASE_TYPE = "milestone"
} else if (PROJECT_VERSION.endsWith('SNAPSHOT')) {
@@ -175,6 +178,8 @@ pipeline {
RELEASE_TYPE = 'snapshot'
}
echo "Release type: ${RELEASE_TYPE}"
if (RELEASE_TYPE == 'release') {
STAGING_REPOSITORY_ID = sh(

View File

@@ -2,14 +2,9 @@
set -euo pipefail
RAW_VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dgradle.cache.local.enabled=false -Dgradle.cache.remote.enabled=false \
-Dexpression=project.version -q -DforceStdout`
VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate \
-Dexpression=project.version -q -DforceStdout | tail -1`
# Split things up
VERSION_PARTS=($RAW_VERSION)
# Grab the last part, which is the actual version number.
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}
echo $VERSION