mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
update-authors-json: Write to static, not STATIC_ROOT.
Otherwise the file isn’t processed by collectstatic and doesn’t end up in the staticfiles.json manifest. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
1d05a71b5d
commit
5f712b960f
@@ -21,10 +21,6 @@ from datetime import date
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/tests/fixtures/authors.json')
|
FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/tests/fixtures/authors.json')
|
||||||
duplicate_commits_file = os.path.join(os.path.dirname(__file__),
|
duplicate_commits_file = os.path.join(os.path.dirname(__file__),
|
||||||
'../zerver/tests/fixtures/duplicate_commits.json')
|
'../zerver/tests/fixtures/duplicate_commits.json')
|
||||||
@@ -144,7 +140,7 @@ def run_production() -> None:
|
|||||||
contributor_data['name'] = contributor_name
|
contributor_data['name'] = contributor_name
|
||||||
data['contrib'].append(contributor_data)
|
data['contrib'].append(contributor_data)
|
||||||
|
|
||||||
write_to_disk(data, settings.CONTRIBUTORS_DATA)
|
write_to_disk(data, 'static/generated/github-contributors.json')
|
||||||
|
|
||||||
|
|
||||||
def copy_fixture() -> None:
|
def copy_fixture() -> None:
|
||||||
@@ -152,7 +148,7 @@ def copy_fixture() -> None:
|
|||||||
Copy test fixture file from zerver/tests/fixtures. This is used to avoid
|
Copy test fixture file from zerver/tests/fixtures. This is used to avoid
|
||||||
constantly fetching data from Github during testing.
|
constantly fetching data from Github during testing.
|
||||||
"""
|
"""
|
||||||
shutil.copyfile(FIXTURE_FILE, settings.CONTRIBUTORS_DATA)
|
shutil.copyfile(FIXTURE_FILE, 'static/generated/github-contributors.json')
|
||||||
|
|
||||||
|
|
||||||
if args.use_fixture:
|
if args.use_fixture:
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ run(['./tools/setup/build_pygments_data'], stdout=fp, stderr=fp)
|
|||||||
# Create webpack bundle
|
# Create webpack bundle
|
||||||
run(['./tools/webpack'], stdout=fp, stderr=fp)
|
run(['./tools/webpack'], stdout=fp, stderr=fp)
|
||||||
|
|
||||||
|
# Generate /team page markdown for authors
|
||||||
|
authors_cmd = ['./tools/update-authors-json']
|
||||||
|
if os.environ.get("TRAVIS"):
|
||||||
|
authors_cmd.append("--use-fixture")
|
||||||
|
if args.authors_not_required:
|
||||||
|
authors_cmd.append("--not-required")
|
||||||
|
run(authors_cmd, stdout=fp, stderr=fp)
|
||||||
|
|
||||||
# Collect the files that we're going to serve; this creates prod-static/serve.
|
# Collect the files that we're going to serve; this creates prod-static/serve.
|
||||||
run(['./manage.py', 'collectstatic', '--no-default-ignore',
|
run(['./manage.py', 'collectstatic', '--no-default-ignore',
|
||||||
'--noinput', '-i', 'assets', '-i', 'js', '-i', 'styles', '-i', 'templates'],
|
'--noinput', '-i', 'assets', '-i', 'js', '-i', 'styles', '-i', 'templates'],
|
||||||
@@ -67,12 +75,4 @@ run(['./manage.py', 'compilemessages'], stdout=fp, stderr=fp)
|
|||||||
# Needed if PRODUCTION
|
# Needed if PRODUCTION
|
||||||
os.makedirs('prod-static', exist_ok=True)
|
os.makedirs('prod-static', exist_ok=True)
|
||||||
|
|
||||||
# Generate /team page markdown for authors
|
|
||||||
authors_cmd = ['./tools/update-authors-json']
|
|
||||||
if os.environ.get("TRAVIS"):
|
|
||||||
authors_cmd.append("--use-fixture")
|
|
||||||
if args.authors_not_required:
|
|
||||||
authors_cmd.append("--not-required")
|
|
||||||
run(authors_cmd, stdout=fp, stderr=fp)
|
|
||||||
|
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user