version: Show number of commits and commit sha in ZULIP_VERSION.

We use `git describe --tags` to get information about the number of commit since
the last major version, and the sha of the current HEAD. This is added to the
ZULIP_VERSION when a deploy is done from `git`.

Modified heavily by punchagan to:
* to use git describe instead of `git log` and `wc`
* use a separate script to run the git describe command
* write the file with version info to var/ and remove it from the repo

Fixes #4685.
This commit is contained in:
ppreethi
2019-04-20 23:51:20 -04:00
committed by Tim Abbott
parent 8261c394b9
commit 86840adda5
5 changed files with 24 additions and 1 deletions

View File

@@ -62,6 +62,11 @@ cd "$BASEDIR"
# Check out a temporary full copy of the index to generate static files
git checkout-index -f -a --prefix "$TMPDIR/$prefix/"
# Add the git version information file
./tools/cache-zulip-git-version
mv zulip-git-version "$TMPDIR/$prefix/"
cd "$TMPDIR/$prefix"
# create var/log directory in the new temporary checkout
@@ -109,7 +114,7 @@ echo "$version" > version
cd "$TMPDIR"
tar --append -f "$TARBALL" "$prefix/prod-static" "$prefix/build_id" "$prefix/version" "$prefix/staticfiles.json" "$prefix/templates/zerver/emails/compiled" "$prefix/webpack-stats-production.json"
tar --append -f "$TARBALL" "$prefix/prod-static" "$prefix/build_id" "$prefix/version" "$prefix/zulip-git-version" "$prefix/staticfiles.json" "$prefix/templates/zerver/emails/compiled" "$prefix/webpack-stats-production.json"
rm -rf "$prefix"