Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B235C200D01 for ; Fri, 22 Sep 2017 09:15:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B0C531609BE; Fri, 22 Sep 2017 07:15:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00E9B1609A7 for ; Fri, 22 Sep 2017 09:15:32 +0200 (CEST) Received: (qmail 7381 invoked by uid 500); 22 Sep 2017 07:15:32 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 7372 invoked by uid 99); 22 Sep 2017 07:15:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2017 07:15:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EBFB2E0395; Fri, 22 Sep 2017 07:15:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: holden@apache.org To: commits@spark.apache.org Message-Id: <25a03696ed65438b8d7b453b410d975c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: [SPARK-22072][SPARK-22071][BUILD] Improve release build scripts Date: Fri, 22 Sep 2017 07:15:31 +0000 (UTC) archived-at: Fri, 22 Sep 2017 07:15:33 -0000 Repository: spark Updated Branches: refs/heads/branch-2.1 1a4b6eea8 -> d930bbb40 [SPARK-22072][SPARK-22071][BUILD] Improve release build scripts ## What changes were proposed in this pull request? Check JDK version (with javac) and use SPARK_VERSION for publish-release ## How was this patch tested? Manually tried local build with wrong JDK / JAVA_HOME & built a local release (LFTP disabled) Author: Holden Karau Closes #19312 from holdenk/improve-release-scripts-r2. (cherry picked from commit 8f130ad40178e35fecb3f2ba4a61ad23e6a90e3d) Signed-off-by: Holden Karau Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d930bbb4 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d930bbb4 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d930bbb4 Branch: refs/heads/branch-2.1 Commit: d930bbb40648a39c44780ba51513489923babd3e Parents: 1a4b6ee Author: Holden Karau Authored: Fri Sep 22 00:14:57 2017 -0700 Committer: Holden Karau Committed: Fri Sep 22 00:15:27 2017 -0700 ---------------------------------------------------------------------- dev/create-release/release-build.sh | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/d930bbb4/dev/create-release/release-build.sh ---------------------------------------------------------------------- diff --git a/dev/create-release/release-build.sh b/dev/create-release/release-build.sh index c4ddc21..fa889d9 100755 --- a/dev/create-release/release-build.sh +++ b/dev/create-release/release-build.sh @@ -31,8 +31,8 @@ Top level targets are All other inputs are environment variables GIT_REF - Release tag or commit to build from -SPARK_VERSION - Release identifier used when publishing -SPARK_PACKAGE_VERSION - Release identifier in top level package directory +SPARK_VERSION - Version of Spark being built (e.g. 2.1.2) +SPARK_PACKAGE_VERSION - Release identifier in top level package directory (e.g. 2.1.2-rc1) REMOTE_PARENT_DIR - Parent in which to create doc or release builds. REMOTE_PARENT_MAX_LENGTH - If set, parent directory will be cleaned to only have this number of subdirectories (by deleting old ones). WARNING: This deletes data. @@ -95,6 +95,33 @@ if [ -z "$SPARK_VERSION" ]; then | grep -v INFO | grep -v WARNING | grep -v Download) fi +# Verify we have the right java version set +if [ -z "$JAVA_HOME" ]; then + echo "Please set JAVA_HOME." + exit 1 +fi + +java_version=$("${JAVA_HOME}"/bin/javac -version 2>&1 | cut -d " " -f 2) + +if [[ ! $SPARK_VERSION < "2.2." ]]; then + if [[ $java_version < "1.8." ]]; then + echo "Java version $java_version is less than required 1.8 for 2.2+" + echo "Please set JAVA_HOME correctly." + exit 1 + fi +else + if [[ $java_version > "1.7." ]]; then + if [ -z "$JAVA_7_HOME" ]; then + echo "Java version $java_version is higher than required 1.7 for pre-2.2" + echo "Please set JAVA_HOME correctly." + exit 1 + else + JAVA_HOME="$JAVA_7_HOME" + fi + fi +fi + + if [ -z "$SPARK_PACKAGE_VERSION" ]; then SPARK_PACKAGE_VERSION="${SPARK_VERSION}-$(date +%Y_%m_%d_%H_%M)-${git_hash}" fi @@ -322,6 +349,8 @@ if [[ "$1" == "publish-snapshot" ]]; then fi if [[ "$1" == "publish-release" ]]; then + SPARK_VERSION=$SPARK_PACKAGE_VERSION + cd spark # Publish Spark to Maven release repo echo "Publishing Spark checkout at '$GIT_REF' ($git_hash)" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org