zulip/tools/build-local-server-tarball

37 lines
821 B
Plaintext
Raw Normal View History

#!/bin/sh -ex
GITID=$(git rev-parse HEAD)
if [ "$(uname)" = "Darwin" ]; then
TMPDIR=/tmp/local-server
rm -Rf $TMPDIR
mkdir -p $TMPDIR
else
TMPDIR=$(mktemp -d)
fi
TMP_CHECKOUT=$TMPDIR/zulip-server/
TARBALL=$TMPDIR/zulip-server.tar
# .gitattributes lists the files that are not exported
git archive -o $TARBALL --prefix=zulip-server/ HEAD
# Check out a temporary full copy of the index to generate static files
git checkout-index -f -a --prefix $TMP_CHECKOUT
cd $TMP_CHECKOUT
# 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 ..
cd $TMPDIR
tar --append -f $TARBALL zulip-server/prod-static zulip-server/version_id
rm -r zulip-server
gzip $TARBALL
echo "Generated $TARBALL.gz"