2013-10-29 20:04:55 +01:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
2013-11-01 20:54:41 +01:00
|
|
|
GITID=$(git rev-parse HEAD)
|
|
|
|
|
2013-11-06 19:15:04 +01:00
|
|
|
if [ "$(uname)" = "Darwin" ]; then
|
|
|
|
TMPDIR=/tmp/local-server
|
|
|
|
rm -Rf $TMPDIR
|
|
|
|
mkdir -p $TMPDIR
|
|
|
|
else
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
fi
|
|
|
|
|
2013-11-12 17:13:19 +01:00
|
|
|
TMP_CHECKOUT=$TMPDIR/zulip-server/
|
|
|
|
TARBALL=$TMPDIR/zulip-server.tar
|
2013-11-01 20:54:41 +01:00
|
|
|
|
2013-11-12 17:13:19 +01:00
|
|
|
# .gitattributes lists the files that are not exported
|
|
|
|
git archive -o $TARBALL --prefix=zulip-server/ HEAD
|
2013-11-01 20:54:41 +01:00
|
|
|
|
2013-11-12 17:13:19 +01:00
|
|
|
# Check out a temporary full copy of the index to generate static files
|
|
|
|
git checkout-index -f -a --prefix $TMP_CHECKOUT
|
|
|
|
cd $TMP_CHECKOUT
|
2013-11-01 20:54:41 +01:00
|
|
|
|
|
|
|
# update-prod-static generates the prod-static directory.
|
|
|
|
# See COLLECTSTATIC in settings.py
|
|
|
|
./tools/update-prod-static
|
|
|
|
echo $GITID > version_id
|
|
|
|
mv update-prod-static.log ..
|
|
|
|
|
2013-11-12 17:13:19 +01:00
|
|
|
cd $TMPDIR
|
|
|
|
|
|
|
|
tar --append -f $TARBALL zulip-server/prod-static zulip-server/version_id
|
2013-11-01 20:54:41 +01:00
|
|
|
|
|
|
|
rm -r zulip-server
|
2013-11-12 17:13:19 +01:00
|
|
|
|
|
|
|
gzip $TARBALL
|
|
|
|
echo "Generated $TARBALL.gz"
|