Deploy Development / deploy (push) Failing after 40s
Testdaten entstehen nur dort und werden danach entfernt, damit Dev und Produktion sie nicht behalten. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
724 B
Python
27 lines
724 B
Python
"""Migrate, drop leftover fixtures, then serve. Demo seed never runs here."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from app.core.settings import Settings, get_settings
|
|
from app.db.migrate import migrate
|
|
from app.fixtures import purge_fixture_data
|
|
|
|
|
|
def prepare(settings: Settings | None = None) -> None:
|
|
settings = settings or get_settings()
|
|
if settings.tsumugu_env == "production" and settings.seed_demo:
|
|
raise SystemExit("SEED_DEMO darf in der Produktion nicht aktiv sein.")
|
|
migrate(settings)
|
|
purge_fixture_data(settings)
|
|
|
|
|
|
def main() -> None:
|
|
prepare()
|
|
os.execvp("uvicorn", ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|