Skip to content

Commit 5e251c4

Browse files
authored
HBASE-27442 Change the way of bumping version in release scripts
Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 792f12b commit 5e251c4

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

dev-support/create-release/release-util.sh

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,38 @@ function kick_gpg_agent {
685685
# Do maven command to set version into local pom
686686
function maven_set_version { #input: <version_to_set>
687687
local this_version="$1"
688-
log "${MVN[@]}" versions:set -DnewVersion="$this_version"
689-
"${MVN[@]}" versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
688+
local use_revision='false'
689+
local -a version_splits=()
690+
IFS='.' read -ar version_splits <<< "$(maven_get_version)"
691+
692+
# Do the right thing based on project and release line.
693+
if [ "${PROJECT}" = 'hbase' ] ; then
694+
if [ "${version_splits[0]}" -le 1 ] ; then
695+
use_revision='false'
696+
elif [ "${version_splits[0]}" -eq 2 ] && [ "${version_splits[1]}" -le 4 ] ; then
697+
use_revision='false'
698+
elif [ "${version_splits[0]}" -eq 2 ] && [ "${version_splits[1]}" -ge 5 ] ; then
699+
use_revision='true'
700+
elif [ "${version_splits[0]}" -ge 3 ] ; then
701+
use_revision='true'
702+
fi
703+
elif [ "${PROJECT}" = 'hbase-thirdparty' ] ; then
704+
use_revision='false'
705+
elif [ "${PROJECT}" = 'hbase-connectors' ] ; then
706+
use_revision='true'
707+
elif [ "${PROJECT}" = 'hbase-filesystem' ] ; then
708+
use_revision='false'
709+
elif [ "${PROJECT}" = 'hbase-operator-tools' ] ; then
710+
use_revision='false'
711+
fi
712+
713+
if [ "${use_revision}" = 'false' ] ; then
714+
log "${MVN[@]}" versions:set -DnewVersion="$this_version"
715+
"${MVN[@]}" versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
716+
else
717+
log "${MVN[@]}" versions:set-property -Dproperty=revision -DnewVersion="$this_version" -DgenerateBackupPoms=false
718+
"${MVN[@]}" versions:set-property -Dproperty=revision -DnewVersion="$this_version" -DgenerateBackupPoms=false | grep -v "no value" # silence logs
719+
fi
690720
}
691721

692722
# Do maven command to read version from local pom

0 commit comments

Comments
 (0)