build-engine-tarballs.sh

This commit is contained in:
Avital Oliver
2013-02-07 16:59:29 -08:00
committed by David Glasser
parent cb64708cae
commit e76e76dd66
2 changed files with 39 additions and 0 deletions

View File

@@ -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

View File

@@ -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