From e76e76dd66dd2a691c511efeffcc42e8fd74246a Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Thu, 7 Feb 2013 16:59:29 -0800 Subject: [PATCH] build-engine-tarballs.sh --- tools/admin/build-engine-tarballs.sh | 37 ++++++++++++++++++++++++++++ tools/admin/build-engine-tree.sh | 2 ++ 2 files changed, 39 insertions(+) create mode 100755 tools/admin/build-engine-tarballs.sh diff --git a/tools/admin/build-engine-tarballs.sh b/tools/admin/build-engine-tarballs.sh new file mode 100755 index 0000000000..8ef9afc382 --- /dev/null +++ b/tools/admin/build-engine-tarballs.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +# cd to top level dir +cd `dirname $0` +cd ../.. +TOPDIR=$(pwd) + +UNAME=$(uname) +ARCH=$(uname -m) + +TMPDIR=$(mktemp -d -t meteor-build-release-XXXXXXXX) +trap 'rm -rf "$TMPDIR" >/dev/null 2>&1' 0 + +# get the engine version. +ENGINE_VERSION="$($TOPDIR/meteor --version | perl -ne 'print $1 if /Engine version (\S+)/')" +echo "Creating tarballs for engine version $ENGINE_VERSION..." + +mkdir -p "$TMPDIR/.meteor/engines" +export TARGET_DIR="$TMPDIR/.meteor/engines/$ENGINE_VERSION" +$TOPDIR/tools/admin/build-engine-tree.sh +ln -s "$ENGINE_VERSION" "$TMPDIR/.meteor/engines/latest" +ln -s engines/latest/bin/meteor "$TMPDIR/.meteor/meteor" + +# tar it up +OUTDIR="$TOPDIR/dist" +rm -rf "$OUTDIR" +mkdir -p "$OUTDIR" + +ENGINE_TARBALL="$OUTDIR/meteor-engine-${ENGINE_VERSION}-${UNAME}-${ARCH}.tar.gz" +echo "Tarring engine to: $ENGINE_TARBALL" +tar -C "$TMPDIR/.meteor/engines" --exclude .meteor/local -czf "$ENGINE_TARBALL" "$ENGINE_VERSION" + +ENGINE_BOOTSTRAP_TARBALL="$OUTDIR/meteor-engine-bootstrap-${UNAME}-${ARCH}.tar.gz" +echo "Tarring engine bootstrap to: $ENGINE_BOOTSTRAP_TARBALL" +tar -C "$TMPDIR" --exclude .meteor/local -czf "$ENGINE_BOOTSTRAP_TARBALL" .meteor diff --git a/tools/admin/build-engine-tree.sh b/tools/admin/build-engine-tree.sh index eda0245941..f98327850c 100755 --- a/tools/admin/build-engine-tree.sh +++ b/tools/admin/build-engine-tree.sh @@ -12,6 +12,8 @@ if [ "$TARGET_DIR" == "" ] ; then exit 1 fi +# Make sure that the entire contents $TARGET_DIR is what we placed +# there if [ -e "$TARGET_DIR" ] ; then echo "$TARGET_DIR already exists" exit 1