python app.py --build to generate build-metadata.json

This is now run by the Dockerfile to build this at compile time.
This commit is contained in:
Simon Willison 2017-10-23 22:53:13 -07:00
commit 606ff9e35e
2 changed files with 6 additions and 1 deletions

6
app.py
View file

@ -8,6 +8,7 @@ from pathlib import Path
from functools import wraps
import json
import hashlib
import sys
app_root = Path(__file__).parent
@ -191,4 +192,7 @@ def resolve_db_name(db_name, **kwargs):
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8006)
if '--build' in sys.argv:
ensure_build_metadata(True)
else:
app.run(host="0.0.0.0", port=8006)