Files
taxbaik/scripts/validate_locked_db_connection.py
T
kjh2064 0f71e8c41f
TaxBaik CI/CD / build-and-deploy (push) Failing after 23s
Fix admin WASM shell and E2E auth
2026-07-07 15:47:29 +09:00

37 lines
1015 B
Python

import json
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
EXPECTED = "Host=localhost;Database=taxbaikdb;Username=taxbaik;Password=taxbaik123"
TARGETS = [
ROOT / "src" / "TaxBaik.Web" / "appsettings.json",
ROOT / "src" / "TaxBaik.Web" / "appsettings.Development.json",
]
def main() -> int:
failed = False
for path in TARGETS:
try:
data = json.loads(path.read_text(encoding="utf-8"))
actual = data["ConnectionStrings"]["Default"]
except Exception as exc:
print(f"ERROR: {path} could not be read: {exc}")
failed = True
continue
if actual != EXPECTED:
print(f"ERROR: {path} connection string mismatch")
print(f" expected: {EXPECTED}")
print(f" actual: {actual}")
failed = True
else:
print(f"OK: {path} connection string locked")
return 1 if failed else 0
if __name__ == "__main__":
sys.exit(main())