Skip to content

Commit

Permalink
[SPARK-2233] make-distribution script should list the git hash in the…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>

Closes apache#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.
  • Loading branch information
gballet authored and pwendell committed Jun 28, 2014
1 parent 0e0686d commit b8f2e13
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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/"
Expand Down

0 comments on commit b8f2e13

Please sign in to comment.