You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2022/10/25 16:18:38 UTC

[hbase] branch master updated: HBASE-27442 Change the way of bumping version in release scripts

This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e251c49d01 HBASE-27442 Change the way of bumping version in release scripts
5e251c49d01 is described below

commit 5e251c49d01a45c177d17bac7ee4e923d2bd2df7
Author: Nick Dimiduk <nd...@apache.org>
AuthorDate: Tue Oct 25 18:18:26 2022 +0200

    HBASE-27442 Change the way of bumping version in release scripts
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 dev-support/create-release/release-util.sh | 34 ++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/dev-support/create-release/release-util.sh b/dev-support/create-release/release-util.sh
index 6241a8538a0..fdb078810ce 100755
--- a/dev-support/create-release/release-util.sh
+++ b/dev-support/create-release/release-util.sh
@@ -685,8 +685,38 @@ function kick_gpg_agent {
 # Do maven command to set version into local pom
 function maven_set_version { #input: <version_to_set>
   local this_version="$1"
-  log "${MVN[@]}" versions:set -DnewVersion="$this_version"
-  "${MVN[@]}" versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
+  local use_revision='false'
+  local -a version_splits=()
+  IFS='.' read -ar version_splits <<< "$(maven_get_version)"
+
+  # Do the right thing based on project and release line.
+  if [ "${PROJECT}" = 'hbase' ] ; then
+    if [ "${version_splits[0]}" -le 1 ] ; then
+      use_revision='false'
+    elif [ "${version_splits[0]}" -eq 2 ] && [ "${version_splits[1]}" -le 4 ] ; then
+      use_revision='false'
+    elif [ "${version_splits[0]}" -eq 2 ] && [ "${version_splits[1]}" -ge 5 ] ; then
+      use_revision='true'
+    elif [ "${version_splits[0]}" -ge 3 ] ; then
+      use_revision='true'
+    fi
+  elif [ "${PROJECT}" = 'hbase-thirdparty' ] ; then
+    use_revision='false'
+  elif [ "${PROJECT}" = 'hbase-connectors' ] ; then
+    use_revision='true'
+  elif [ "${PROJECT}" = 'hbase-filesystem' ] ; then
+    use_revision='false'
+  elif [ "${PROJECT}" = 'hbase-operator-tools' ] ; then
+    use_revision='false'
+  fi
+
+  if [ "${use_revision}" = 'false' ] ; then
+    log "${MVN[@]}" versions:set -DnewVersion="$this_version"
+    "${MVN[@]}" versions:set -DnewVersion="$this_version" | grep -v "no value" # silence logs
+  else
+    log "${MVN[@]}" versions:set-property -Dproperty=revision -DnewVersion="$this_version" -DgenerateBackupPoms=false
+    "${MVN[@]}" versions:set-property -Dproperty=revision -DnewVersion="$this_version" -DgenerateBackupPoms=false | grep -v "no value" # silence logs
+  fi
 }
 
 # Do maven command to read version from local pom