Skip to content

Commit

Permalink
build-local-server-tarball: Add prod-static to a clean git archive ta…
Browse files Browse the repository at this point in the history
…rball

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

(imported from commit 8bdb9de3867b10eb5be9f52b784aa906c5f19d23)
  • Loading branch information
Kevin Mehall committed Nov 12, 2013
1 parent 3f0fa36 commit d0b81f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
37 changes: 13 additions & 24 deletions tools/build-local-server-tarball
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d0b81f6

Please sign in to comment.