From e56d3196efdebeebd6083e942dc4f1a5b9ac8ddb Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Mon, 2 May 2016 13:20:00 +0500 Subject: [PATCH] Update provisioning/release scripts to build `.mo` files. We need to update provision.py to compile the messages files, since they are needed for the new i18n tests. And of course we need to include the .mo files in release tarballs; there's a bit of complexity there around how the tarball archives are created. --- .gitattributes | 1 + README.dev.md | 1 + provision.py | 1 + tools/build-release-tarball | 2 +- tools/update-prod-static | 4 ++++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 9656b8609c..9784838523 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,3 +18,4 @@ /frontend_tests export-ignore /node_modules export-ignore /humbug export-ignore +/locale export-ignore diff --git a/README.dev.md b/README.dev.md index 5965fdc533..3a372b0253 100644 --- a/README.dev.md +++ b/README.dev.md @@ -341,6 +341,7 @@ if [ $(uname) = "OpenBSD" ]; then sudo cp ./puppet/zulip/files/postgresql/zulip_ ./tools/do-destroy-rebuild-database ./tools/postgres-init-test-db ./tools/do-destroy-rebuild-test-database +./manage.py compilemessages npm install ``` diff --git a/provision.py b/provision.py index 118a17d810..4666735000 100644 --- a/provision.py +++ b/provision.py @@ -185,6 +185,7 @@ def main(): run(["tools/do-destroy-rebuild-database"]) run(["tools/postgres-init-test-db"]) run(["tools/do-destroy-rebuild-test-database"]) + run(["python", "./manage.py", "compilemessages"]) # Install the latest npm. run(["sudo", "npm", "install", "-g", "npm"]) # Run npm install last because it can be flaky, and that way one diff --git a/tools/build-release-tarball b/tools/build-release-tarball index c1877afd2f..695c5f1f56 100755 --- a/tools/build-release-tarball +++ b/tools/build-release-tarball @@ -83,7 +83,7 @@ find prod-static/serve/third/gemoji/images/emoji/ -regex '.*\.[0-9a-f]+\.png' -d cd "$TMPDIR" -tar --append -f "$TARBALL" "$prefix/prod-static" "$prefix/build_id" "$prefix/version" +tar --append -f "$TARBALL" "$prefix/prod-static" "$prefix/build_id" "$prefix/version" "$prefix/locale" rm -rf "$prefix" diff --git a/tools/update-prod-static b/tools/update-prod-static index 0e990db901..3e71a94c00 100755 --- a/tools/update-prod-static +++ b/tools/update-prod-static @@ -45,6 +45,10 @@ subprocess.check_call(['bash', '-ex', 'tools/download-zxcvbn'], subprocess.check_call(['python', './manage.py', 'collectstatic', '--noinput'], stdout=fp, stderr=fp) +# Compile translation strings to generate `.mo` files. +subprocess.check_call(['python', './manage.py', 'compilemessages'], + stdout=fp, stderr=fp) + # Move the source maps out of the serve/ directory and into their # proper place. subprocess.check_call(['rm', '-rf', 'prod-static/source-map'],