Skip to content
Snippets Groups Projects
Commit a96b4ef7 authored by seanm's avatar seanm
Browse files

dding tgz option to make-distribution.sh

parent e3d3e6f0
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/usr/bin/env bash
# #
# Script to create a binary distribution for easy deploys of Spark. # Script to create a binary distribution for easy deploys of Spark.
# The distribution directory defaults to dist/ but can be overridden below. # The distribution directory defaults to dist/ but can be overridden below.
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
# so it is completely self contained. # so it is completely self contained.
# It does not contain source or *.class files. # It does not contain source or *.class files.
# #
# Arguments
# (none): Creates dist/ directory
# tgz: Additionally creates spark-$VERSION-bin.tar.gz
#
# Recommended deploy/testing procedure (standalone mode): # Recommended deploy/testing procedure (standalone mode):
# 1) Rsync / deploy the dist/ dir to one host # 1) Rsync / deploy the dist/ dir to one host
# 2) cd to deploy dir; ./bin/start-master.sh # 2) cd to deploy dir; ./bin/start-master.sh
...@@ -19,8 +23,14 @@ DISTDIR="$FWDIR/dist" ...@@ -19,8 +23,14 @@ DISTDIR="$FWDIR/dist"
# Get version from SBT # Get version from SBT
export TERM=dumb # Prevents color codes in SBT output export TERM=dumb # Prevents color codes in SBT output
VERSION=$($FWDIR/sbt/sbt "show version" | tail -1 | cut -f 2) VERSION=$($FWDIR/sbt/sbt "show version" | tail -1 | cut -f 2 | sed 's/^\([a-zA-Z0-9.-]*\).*/\1/')
echo "Making distribution for Spark $VERSION in $DISTDIR..."
if [ "$1" == "tgz" ]; then
echo "Making spark-$VERSION-bin.tar.gz"
else
echo "Making distribution for Spark $VERSION in $DISTDIR..."
fi
# Build fat JAR # Build fat JAR
$FWDIR/sbt/sbt "repl/assembly" $FWDIR/sbt/sbt "repl/assembly"
...@@ -37,3 +47,11 @@ cp $FWDIR/repl/target/*.jar "$DISTDIR/jars/" ...@@ -37,3 +47,11 @@ cp $FWDIR/repl/target/*.jar "$DISTDIR/jars/"
cp -r "$FWDIR/bin" "$DISTDIR" cp -r "$FWDIR/bin" "$DISTDIR"
cp -r "$FWDIR/conf" "$DISTDIR" cp -r "$FWDIR/conf" "$DISTDIR"
cp "$FWDIR/run" "$FWDIR/spark-shell" "$DISTDIR" cp "$FWDIR/run" "$FWDIR/spark-shell" "$DISTDIR"
if [ "$1" == "tgz" ]; then
TARDIR="$FWDIR/spark-$VERSION"
cp -r $DISTDIR $TARDIR
tar -zcf spark-$VERSION-bin.tar.gz -C $FWDIR spark-$VERSION
rm -rf $TARDIR
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment