aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorseanm <sean.mcnamara@webtrends.com>2013-07-15 19:13:17 -0600
committerseanm <sean.mcnamara@webtrends.com>2013-07-15 19:13:17 -0600
commita96b4ef761aa80310b194176f41a088c5bf6274a (patch)
treeabac8a5a99cd6bbde7bcb67e6fe6c534e0485b1b /make-distribution.sh
parente3d3e6f0ab34f0fe083ef9feb31b9e9fd257519f (diff)
downloadspark-a96b4ef761aa80310b194176f41a088c5bf6274a.tar.gz
spark-a96b4ef761aa80310b194176f41a088c5bf6274a.tar.bz2
spark-a96b4ef761aa80310b194176f41a088c5bf6274a.zip
dding tgz option to make-distribution.sh
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh24
1 files changed, 21 insertions, 3 deletions
diff --git a/make-distribution.sh b/make-distribution.sh
index feb13d52f9..ef3d2529d0 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Script to create a binary distribution for easy deploys of Spark.
# The distribution directory defaults to dist/ but can be overridden below.
@@ -6,6 +6,10 @@
# so it is completely self contained.
# 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):
# 1) Rsync / deploy the dist/ dir to one host
# 2) cd to deploy dir; ./bin/start-master.sh
@@ -19,8 +23,14 @@ DISTDIR="$FWDIR/dist"
# Get version from SBT
export TERM=dumb # Prevents color codes in SBT output
-VERSION=$($FWDIR/sbt/sbt "show version" | tail -1 | cut -f 2)
-echo "Making distribution for Spark $VERSION in $DISTDIR..."
+VERSION=$($FWDIR/sbt/sbt "show version" | tail -1 | cut -f 2 | sed 's/^\([a-zA-Z0-9.-]*\).*/\1/')
+
+if [ "$1" == "tgz" ]; then
+ echo "Making spark-$VERSION-bin.tar.gz"
+else
+ echo "Making distribution for Spark $VERSION in $DISTDIR..."
+fi
+
# Build fat JAR
$FWDIR/sbt/sbt "repl/assembly"
@@ -37,3 +47,11 @@ cp $FWDIR/repl/target/*.jar "$DISTDIR/jars/"
cp -r "$FWDIR/bin" "$DISTDIR"
cp -r "$FWDIR/conf" "$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