build-local-server-tarball: Add prod-static to a clean git archive tarball

This avoids exporting .pyc files and any other junk left behind by the
build process.

(imported from commit 8bdb9de3867b10eb5be9f52b784aa906c5f19d23)
This commit is contained in:
Kevin Mehall 2013-11-12 11:13:19 -05:00
parent 3f0fa363f9
commit d0b81f6b2e
2 changed files with 26 additions and 24 deletions

13
.gitattributes vendored Normal file
View File

@ -0,0 +1,13 @@
.gitignore export-ignore
.gitattributes export-ignore
analytics/ export-ignore
assets/ export-ignore
bots/ export-ignore
corporate/ export-ignore
static/ export-ignore
tools/ export-ignore
zilencer/ export-ignore
templates/analytics/ export-ignore
templates/corporate/ export-ignore
puppet/zulip_internal/ export-ignore
zproject/local_settings.py export-ignore

View File

@ -10,38 +10,27 @@ else
TMPDIR=$(mktemp -d)
fi
DIR=$TMPDIR/zulip-server/
TARBALL=$TMPDIR/zulip-server.tar.gz
TMP_CHECKOUT=$TMPDIR/zulip-server/
TARBALL=$TMPDIR/zulip-server.tar
git checkout-index -f -a --prefix $DIR
# .gitattributes lists the files that are not exported
git archive -o $TARBALL --prefix=zulip-server/ HEAD
cd $DIR
# 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
xargs rm -r <<EOF
analytics
assets
bots
corporate
static
tools
zilencer
.gitignore
templates/.gitignore
templates/analytics
templates/corporate
puppet/zulip_internal
zproject/local_settings.py
EOF
echo $GITID > version_id
mv update-prod-static.log ..
cd ..
tar -czf $TARBALL zulip-server
cd $TMPDIR
tar --append -f $TARBALL zulip-server/prod-static zulip-server/version_id
rm -r zulip-server
echo "Generated $TARBALL"
gzip $TARBALL
echo "Generated $TARBALL.gz"