You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by xu...@apache.org on 2022/04/06 16:42:19 UTC

[hudi] branch master updated: [HUDI-3340] Fix deploy_staging_jars for different profiles (#5240)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ca273274b0 [HUDI-3340] Fix deploy_staging_jars for different profiles (#5240)
ca273274b0 is described below

commit ca273274b0b37c9c7025c5e2bf7befa871f8aa5a
Author: Raymond Xu <27...@users.noreply.github.com>
AuthorDate: Wed Apr 6 09:42:11 2022 -0700

    [HUDI-3340] Fix deploy_staging_jars for different profiles (#5240)
---
 scripts/release/deploy_staging_jars.sh | 68 +++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 25 deletions(-)

diff --git a/scripts/release/deploy_staging_jars.sh b/scripts/release/deploy_staging_jars.sh
index 4bd9158bcc..be75827bb6 100755
--- a/scripts/release/deploy_staging_jars.sh
+++ b/scripts/release/deploy_staging_jars.sh
@@ -21,40 +21,58 @@
 ## Variables with defaults (if not overwritten by environment)
 ##
 MVN=${MVN:-mvn}
-SPARK_VERSION=2
 # fail immediately
 set -o errexit
 set -o nounset
-# print command before executing
-set -o xtrace
 
-CURR_DIR=`pwd`
-if [[ `basename $CURR_DIR` != "scripts" ]] ; then
-  echo "You have to call the script from the scripts/ dir"
+CURR_DIR=$(pwd)
+if [ ! -d "$CURR_DIR/packaging" ] ; then
+  echo "You have to call the script from the repository root dir that contains 'packaging/'"
   exit 1
 fi
 
-if [[ $# -lt 1 ]]; then
-    echo "This script will deploy artifacts to staging repositories"
-    echo "There is one param required:"
-    echo "--scala_version=\${SCALA_VERSION}"
-    exit
-else
-    for param in "$@"
-    do
-	if [[ $param =~ --scala_version\=(2\.1[1-2]) ]]; then
-		SCALA_VERSION=${BASH_REMATCH[1]}
-      elif [[ $param =~ --spark_version\=([2-3]) ]]; then
-              SPARK_VERSION=${BASH_REMATCH[1]}
-	fi
-    done
+if [ "$#" -gt "1" ]; then
+  echo "Only accept 0 or 1 argument. Use -h to see examples."
+  exit 1
 fi
 
-###########################
+declare -a ALL_VERSION_OPTS=(
+"-Dscala-2.11 -Dspark2.4 -Dflink1.13"
+"-Dscala-2.12 -Dspark2.4 -Dflink1.13"
+"-Dscala-2.12 -Dspark3.1 -Dflink1.14"
+"-Dscala-2.12 -Dspark3.2 -Dflink1.14"
+)
+printf -v joined "'%s'\n" "${ALL_VERSION_OPTS[@]}"
+
+if [ "${1:-}" == "-h" ]; then
+  echo "
+Usage: $(basename "$0") [OPTIONS]
+
+Options:
+<version option>  One of the version options below
+${joined}
+-h, --help
+"
+  exit 0
+fi
 
-cd ..
+VERSION_OPT=${1:-}
+valid_version_opt=false
+for v in "${ALL_VERSION_OPTS[@]}"; do
+    [[ $VERSION_OPT == "$v" ]] && valid_version_opt=true
+done
 
-echo "Deploying to repository.apache.org with scala version ${SCALA_VERSION}"
+if [ "$valid_version_opt" = true ]; then
+  # run deploy for only specified version option
+  ALL_VERSION_OPTS=("$VERSION_OPT")
+elif [ "$#" == "1" ]; then
+  echo "Version option $VERSION_OPT is invalid. Use -h to see examples."
+  exit 1
+fi
 
-COMMON_OPTIONS="-Dscala-${SCALA_VERSION} -Dspark${SPARK_VERSION} -Prelease -DskipTests -DretryFailedDeploymentCount=10 -DdeployArtifacts=true"
-$MVN clean deploy $COMMON_OPTIONS
+for v in "${ALL_VERSION_OPTS[@]}"
+do
+  echo "Deploying to repository.apache.org with version option ${v}"
+  COMMON_OPTIONS="${v} -Prelease -DskipTests -DretryFailedDeploymentCount=10 -DdeployArtifacts=true"
+  echo $COMMON_OPTIONS
+done