feat: sincronizar scaffold completo del shape web-backend/python
Sincroniza el scaffold canónico desde templates/web-backend-python/ del repo IDP. Reemplaza el placeholder mínimo previo (.gitea/workflows/ci.yaml, README.md, .gitignore, catalog-info.yaml) por el scaffold completo documentado en ADR-053 §3: - code/ — FastAPI app con /health (db check), /metrics, /demo estático, middleware correlation_id, settings Pydantic, db.py con SQLAlchemy - code/alembic/ — migración inicial vacía + env.py usando MIGRATION_DATABASE_URL - code/tests/ — pytest + httpx TestClient (test_health, test_demo) - helm/APP_NAME/ — chart con Deployment, Service, IngressRoute Traefik, NetworkPolicy, ServiceMonitor, Job alembic-upgrade como hook pre-upgrade,pre-install (backoffLimit: 0) - coralware-shape.yaml — manifiesto v1alpha1 del contrato del shape - claim-mariadb.yaml — AddonClaim declarativo (uso futuro ADR-052) - catalog-info.yaml — entidad Backstage actualizada - .gitea/workflows/APP_NAME-build.yaml — invoca reusable workflow ADR-038 + job helm-deploy con KUBECONFIG_TENANT_B64 Placeholders __APP_NAME__, __TIER__, __TENANT_ID__, __TENANT_ID_NODASHES__ serán sustituidos server-side por repo-provisioner cuando materialice el template para un tenant (pendiente — ADR-053 §11.5). El openspec/ del golden path NO se sincroniza al repo Gitea (gobernanza interna de Coralware). Refs: ADR-052, ADR-053, poc-nexobms.md (PoC NexoBMS Demetrio).
This commit is contained in:
32
helm/APP_NAME/templates/_helpers.tpl
Normal file
32
helm/APP_NAME/templates/_helpers.tpl
Normal file
@@ -0,0 +1,32 @@
|
||||
{{/*
|
||||
Labels comunes a todos los recursos del chart.
|
||||
Sigue convenciones CLAUDE.md global + IDP (idp.coralware.cloud/*).
|
||||
*/}}
|
||||
{{- define "app.labels" -}}
|
||||
app.kubernetes.io/name: {{ .Chart.Name }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: {{ .Chart.Name }}
|
||||
idp.coralware.cloud/tier: {{ .Values.tier | quote }}
|
||||
idp.coralware.cloud/tenant-id: {{ .Values.tenantId | quote }}
|
||||
idp.coralware.cloud/golden-path: {{ .Values.goldenPath }}
|
||||
idp.coralware.cloud/golden-path-lang: {{ .Values.goldenPathLang }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels — subset estable de app.labels usado en Deployment.spec.selector
|
||||
y Service.spec.selector. NO debe incluir labels que cambien (version, tier).
|
||||
*/}}
|
||||
{{- define "app.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ .Chart.Name }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Checksum del Secret de la BD — fuerza rollout cuando rota el secret.
|
||||
*/}}
|
||||
{{- define "app.dbSecretChecksum" -}}
|
||||
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.database.secretName }}
|
||||
{{- if $secret }}{{ toYaml $secret.data | sha256sum }}{{ else }}absent{{ end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user