aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2014-06-28 13:07:12 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-06-28 13:07:12 -0700
commitb8f2e13aec715e038bd6d1d07b607683f138ac83 (patch)
tree1b23e9ef70e2365e49498ccda069a4cfb4e5cd47 /make-distribution.sh
parent0e0686d3ef88e024fcceafe36a0cdbb953f5aeae (diff)
downloadspark-b8f2e13aec715e038bd6d1d07b607683f138ac83.tar.gz
spark-b8f2e13aec715e038bd6d1d07b607683f138ac83.tar.bz2
spark-b8f2e13aec715e038bd6d1d07b607683f138ac83.zip
[SPARK-2233] make-distribution script should list the git hash in the RELEASE file
This patch adds the git revision hash (short version) to the RELEASE file. It uses git instead of simply checking for the existence of .git, so as to make sure that this is a functional repository. Author: Guillaume Ballet <gballet@gmail.com> Closes #1216 from gballet/master and squashes the following commits: eabc50f [Guillaume Ballet] Refactored the script to take comments into account. d93e5e8 [Guillaume Ballet] [SPARK 2233] make-distribution script now lists the git hash tag in the RELEASE file.
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/make-distribution.sh b/make-distribution.sh
index 86868438e7..94b473bf91 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -100,6 +100,14 @@ if [ -z "$JAVA_HOME" ]; then
exit -1
fi
+if which git &>/dev/null; then
+ GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
+ if [ ! -z $GITREV ]; then
+ GITREVSTRING=" (git revision $GITREV)"
+ fi
+ unset GITREV
+fi
+
if ! which mvn &>/dev/null; then
echo -e "You need Maven installed to build Spark."
echo -e "Download Maven from https://maven.apache.org/"
@@ -186,7 +194,7 @@ ${BUILD_COMMAND}
# Make directories
rm -rf "$DISTDIR"
mkdir -p "$DISTDIR/lib"
-echo "Spark $VERSION built for Hadoop $SPARK_HADOOP_VERSION" > "$DISTDIR/RELEASE"
+echo "Spark $VERSION$GITREVSTRING built for Hadoop $SPARK_HADOOP_VERSION" > "$DISTDIR/RELEASE"
# Copy jars
cp $FWDIR/assembly/target/scala*/*assembly*hadoop*.jar "$DISTDIR/lib/"