virajjasani commented on a change in pull request #1089:
URL: https://github.com/apache/phoenix/pull/1089#discussion_r557601844



##########
File path: dev/rebuild_hbase.sh
##########
@@ -14,10 +14,34 @@
 # Rebuilds HBase with -Dhadoop.profile=3.0 locally, to work around PHOENIX-5993
 # Intended mainly for CI jobs, but can simplify manual rebuilds as well.
 
+
+DEV_SUPPORT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+ARTIFACTS_DIR="$DEV_SUPPORT/artifacts"
+WORK_DIR="$DEV_SUPPORT/work"
+
+if [[ ! -z "$MAVEN_SETTINGS_FILE" ]]; then
+  SETTINGS=( "--settings" "$MAVEN_SETTINGS_FILE" )
+fi
+
+if [[ ! -z "$MAVEN_LOCAL_REPO" ]]; then
+  LOCALREPO="-Dmaven.repo.local=${MAVEN_LOCAL_REPO}"
+fi
+
+if [[ "$1" == "detect" ]]; then
+  set -e
+  cd "$DEV_SUPPORT/.."
+  HBASE_VERSION=$(mvn ${SETTINGS[@]} help:evaluate -Dexpression=hbase.version 
-q -DforceStdout $LOCALREPO)
+  echo "HBASE_VERSION=$HBASE_VERSION"
+  cd "$DEV_SUPPORT"
+  set +e
+else
+  HBASE_VERSION="$1"
+fi
+
 # The name of the Apache Hbase source file
-HBASE_SOURCE_NAME="hbase-$1-src.tar.gz"
+HBASE_SOURCE_NAME="hbase-$HBASE_VERSION-src.tar.gz"
 # The relative path on the ASF mirrors for the Hbase source file
-HBASE_SOURCE_MIRROR_NAME="hbase/$1/$HBASE_SOURCE_NAME"
+HBASE_SOURCE_MIRROR_NAME="hbase/$HBASE_VERSION/$HBASE_SOURCE_NAME"

Review comment:
       `HBASE_VERSION` is not going to be available if rebuild_hbase doesn't 
have first arg `detect` right? Should we not stick to `$1` here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to