Files
upstream-zulip/tools/update-prod-static
upstream-mirror 64898b2c79
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
2026-09-15 15:05:30 +05:00

74 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
# Updates static files for production.
import os
import sys
# We need settings so we can figure out where the prod-static directory is.
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from scripts.lib.setup_path import setup_path
setup_path()
# check for the venv
from tools.lib import sanity_check
sanity_check.check_venv(__file__)
os.environ["DJANGO_SETTINGS_MODULE"] = "zproject.settings"
os.environ["ZULIP_COLLECTING_STATIC"] = "1"
from django.conf import settings
from scripts.lib.node_cache import setup_node_modules
from scripts.lib.zulip_tools import assert_not_running_as_root, run
assert_not_running_as_root()
os.chdir(settings.DEPLOY_ROOT)
# Install node packages
setup_node_modules(production=True)
# Build emoji
run(["./tools/setup/emoji/build_emoji"])
# Copy over static files from the zulip_bots and integrations packages
run(["./tools/setup/generate_bots_integrations_static_files.py"])
# Build pygments data
run(["./tools/setup/build_pygments_data"])
# Build time zone data
run(["./tools/setup/build_timezone_values"])
# Generate supported browser regex used during initial load
run(["node", "./tools/setup/build_supported_browser_regex.ts"])
# Generate landing page images of various sizes and formats if we will
# need them.
if settings.CORPORATE_ENABLED:
run(["./tools/setup/generate_landing_page_images.py"])
run(
[
"./tools/build-help-center",
"--no-relative-links",
"--out-dir",
"./dist_no_relative_links",
]
)
run(["./tools/build-help-center"])
# Create webpack bundle
run(["./tools/webpack", "--quiet"])
# Collect the files that we're going to serve; this creates prod-static/serve.
run(["./manage.py", "collectstatic", "-v0", "--noinput"])
# Compile translation strings to generate `.mo` files.
run(["./manage.py", "compilemessages", "-v0", "--ignore=*"])
# Needed if PRODUCTION
os.makedirs("prod-static", exist_ok=True)