Commit a88d0378 authored by David Diederich's avatar David Diederich
Browse files

Adding the variable name to the echo statements.

Within the multi-line if blocks, it can be hard to determine what these refer to
parent f7ac9a83
Pipeline #38798 passed with stage
in 14 seconds
......@@ -11,7 +11,7 @@ tag-release-candidate:
- git fetch --tags
# Determine the current Maven version (should be a SNAPSHOT, since this is running on the default branch)
- versionRoot=$($MAVEN help:evaluate -Dexpression=project.version -q -DforceStdout | sed -n 's/-SNAPSHOT//p'); echo $versionRoot
- versionRoot=$($MAVEN help:evaluate -Dexpression=project.version -q -DforceStdout | sed -n 's/-SNAPSHOT//p'); echo "versionRoot=$versionRoot"
- |
if ! [[ "$versionRoot" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "The version from the POM doesn't match expected format: {major}.{minor}.{patch}-SNAPSHOT"
......@@ -21,16 +21,16 @@ tag-release-candidate:
# Look through the Git tags to find the latest release candidate corresponding to this root version
- git tag --list "v${versionRoot}-rc*"
- latestRC=$(git tag --list "v${versionRoot}-rc*" | sed 's/.*-rc//' | sort -n | tail -n 1); echo $latestRC
- latestRC=$(git tag --list "v${versionRoot}-rc*" | sed 's/.*-rc//' | sort -n | tail -n 1); echo "latestRC=$latestRC"
# Determine if we have commits that aren't included in the latest release candidate
# If there is no latestRC (this is the first for this $versionRoot, then we definitely have commits
# that aren't included, so we can skip the rev-list logic).
- |
if [ ! -z "$latestRC" ]; then
latestTag="v${versionRoot}-rc${latestRC}"; echo $latestTag
latestTag="v${versionRoot}-rc${latestRC}"; echo "latestTag=$latestTag"
commitsAhead=$(git rev-list --count ${latestTag}..HEAD); echo $commitsAhead
commitsAhead=$(git rev-list --count ${latestTag}..HEAD); echo "commitsAhead=$commitsAhead"
if [ $commitsAhead -eq 0 ]; then
echo "All commits from HEAD are included in the latest tag ($latestTag)"
echo "Will not create another release candidate"
......@@ -48,8 +48,8 @@ tag-release-candidate:
# Compute the next version and tag by incrementing the latest RC number
# If latestRC is an empty string, $(expr "" + 1) still returns 1, which is correct
- nextVersion="${versionRoot}-rc$(expr $latestRC + 1)"; echo $nextVersion
- nextTag="v${nextVersion}"; echo $nextTag
- nextVersion="${versionRoot}-rc$(expr $latestRC + 1)"; echo "nextVersion=$nextVersion"
- nextTag="v${nextVersion}"; echo "nextTag=$nextTag"
# Apply the new version to the pom files
- $MAVEN_BUILD . maven-tag-rc-output.txt versions:set -DnewVersion=$nextVersion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment