Files
Onyscribe-Admin/scripts/import_tenants.py
RubenRWU 7d8c226da2 Onyscribe Admin: Initialer Stand
Admin-Plattform für die Tenants von Onyscribe: Editor mit Live-Vorschau (echter Core in Sandbox), Versionen, KI-Agent (Cortecs),
OIDC-Abgleich über die Login-Developer-API, Deploy-Engine (Mittwald, gesperrt ohne DEPLOY_LIVE, Freigabe pro Tenant),
Core-Vertrag (Schema/Manifest), Core-Releases mit Kompatibilitätsprüfung, Canary-Rollout und Rollback, Zustandsabgleich.
Runbook: docs/RUNBOOK_PARALLELTEST.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 15:30:26 +02:00

28 lines
1013 B
Python

#!/usr/bin/env python3
"""Importiert die Tenants aus ../transkript-platform in die Admin-DB.
python scripts/import_tenants.py # nur Schlüsselnamen der Secrets
python scripts/import_tenants.py --with-secrets # Secrets via `sops -d` entschlüsseln und verschlüsselt speichern
python scripts/import_tenants.py --force # neue Version auch bei identischem Inhalt
"""
import argparse
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from app.db import init_db, session # noqa: E402
from app.services.importer import import_all # noqa: E402
from app.settings import LEGACY_PLATFORM # noqa: E402
ap = argparse.ArgumentParser()
ap.add_argument("--root", default=str(LEGACY_PLATFORM))
ap.add_argument("--with-secrets", action="store_true")
ap.add_argument("--force", action="store_true")
a = ap.parse_args()
init_db()
with session() as db:
for line in import_all(db, Path(a.root), a.with_secrets, a.force):
print(line)