Skip to content

Commit b8f2e13

Browse files
gballetpwendell
authored andcommitted
[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 <[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.
1 parent 0e0686d commit b8f2e13

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

make-distribution.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ if [ -z "$JAVA_HOME" ]; then
100100
exit -1
101101
fi
102102

103+
if which git &>/dev/null; then
104+
GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
105+
if [ ! -z $GITREV ]; then
106+
GITREVSTRING=" (git revision $GITREV)"
107+
fi
108+
unset GITREV
109+
fi
110+
103111
if ! which mvn &>/dev/null; then
104112
echo -e "You need Maven installed to build Spark."
105113
echo -e "Download Maven from https://maven.apache.org/"
@@ -186,7 +194,7 @@ ${BUILD_COMMAND}
186194
# Make directories
187195
rm -rf "$DISTDIR"
188196
mkdir -p "$DISTDIR/lib"
189-
echo "Spark $VERSION built for Hadoop $SPARK_HADOOP_VERSION" > "$DISTDIR/RELEASE"
197+
echo "Spark $VERSION$GITREVSTRING built for Hadoop $SPARK_HADOOP_VERSION" > "$DISTDIR/RELEASE"
190198

191199
# Copy jars
192200
cp $FWDIR/assembly/target/scala*/*assembly*hadoop*.jar "$DISTDIR/lib/"

0 commit comments

Comments
 (0)