feat: add build info handling and probe endpoint for services

This commit is contained in:
gabdevele
2026-06-17 21:59:06 +02:00 Unverified
parent 72c0d5a014
commit 3b07b10b47
6 changed files with 47 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import json
import os
from pathlib import Path
from django.http import JsonResponse
def build_probe_view(service: str):
info_path = Path("/app/__buildinfo__.json")
info = {}
if info_path.exists():
try:
info = json.loads(info_path.read_text())
except Exception:
info = {}
return JsonResponse(
{
"ok": True,
"service": service,
"build_id": info.get("build_id", ""),
"built_at_utc": info.get("built_at_utc", ""),
"image_marker": info.get("image_marker", ""),
"hostname": os.getenv("HOSTNAME", ""),
}
)