feat(release): GitVersion double central/agent + release notes auto + sécurité CI (Fixes #98 #99 #102, Refs #95 #96 #97 #103)
- GitVersion.yml (central, tags v*) + GitVersion.Agent.yml (agent, tags agent-v*) - release.yml : 2 jobs — tag v* → release central, tag agent-v* → release agent (binaires natifs + image) - ci.yml : gitversion-enabled, trivy-enabled, dependency-check-enabled (templates bloquants) - Dockerfiles : ARG VERSION + -p:Version= (injection assembly) - Endpoint GET /api/version (HealthController) + version agent depuis l'assembly (plus de hardcode) - Makefile : targets version / version-tag / version-tag-agent - Template PR + .gitignore corrigé (configs GitVersion commitables)
This commit is contained in:
1 parent
83d46f0f99
commit
ad36d1d098
6 files changed
+61
-3
No files matched your search
@@ -0,0 +1,24 @@
|
|||||||
|
## Contexte
|
||||||
|
|
||||||
|
<!-- Pourquoi cette PR ? Quel problème résout-elle ? -->
|
||||||
|
|
||||||
|
## Changements
|
||||||
|
|
||||||
|
- [ ] ...
|
||||||
|
|
||||||
|
## Tickets liés
|
||||||
|
|
||||||
|
- Fixes #N / Refs #N
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
- [ ] Build : `dotnet build -c Release`
|
||||||
|
- [ ] Tests : `dotnet test` (ou `make test`)
|
||||||
|
- [ ] CI verte (Trivy, Dependency-Check, SonarQube — politiques bloquantes)
|
||||||
|
- [ ] Release notes / versioning impacté (GitVersion central `v*` / agent `agent-v*`)
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] Commits référencent le ticket (`Fixes #N`)
|
||||||
|
- [ ] Pas de secret en clair (tokens, mots de passe)
|
||||||
|
- [ ] Les CVE signalées par la CI sur cette PR sont traitées ou justifiées
|
||||||
@@ -63,6 +63,7 @@ jobs:
|
|||||||
# SonarQube : en attente d'accès (ticket #101) — secrets sonar_token/sonar_host_url dans Vault secret/data/ci/heimdall
|
# SonarQube : en attente d'accès (ticket #101) — secrets sonar_token/sonar_host_url dans Vault secret/data/ci/heimdall
|
||||||
sonar-enabled: 'false'
|
sonar-enabled: 'false'
|
||||||
trivy-enabled: 'true'
|
trivy-enabled: 'true'
|
||||||
|
dependency-check-enabled: 'true'
|
||||||
docker-images: |
|
docker-images: |
|
||||||
eltruncho/heimdall docker/Dockerfile
|
eltruncho/heimdall docker/Dockerfile
|
||||||
eltruncho/heimdall-agent docker/Dockerfile.agent
|
eltruncho/heimdall-agent docker/Dockerfile.agent
|
||||||
|
|||||||
@@ -87,6 +87,3 @@ templates/
|
|||||||
**/.env
|
**/.env
|
||||||
docker/.env
|
docker/.env
|
||||||
|
|
||||||
# GitVersion (généré au build)
|
|
||||||
GitVersion.yml
|
|
||||||
GitVersion.Agent.yml
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# GitVersion.Agent.yml - Version de l'AGENT (Heimdall.Agent)
|
||||||
|
# Tags de release : agent-v* (ex. agent-v1.0.0). Config separee du central :
|
||||||
|
# l'agent a son propre cycle (tickets #95 #96 #97).
|
||||||
|
# Usage : dotnet-gitversion -config GitVersion.Agent.yml
|
||||||
|
# ATTENTION : tag-prefix personnalise + AUCUN tag agent-v* existant => GitVersion
|
||||||
|
# 6.8.1 echoue ("Failed to parse") - les workflows doivent garder un fallback.
|
||||||
|
workflow: TrunkBased/preview1
|
||||||
|
next-version: 1.0.0
|
||||||
|
assembly-informational-format: '{MajorMinorPatch}+{BranchName}.{ShortSha}'
|
||||||
|
tag-prefix: 'agent-v'
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# GitVersion.yml - Version du CENTRAL (Heimdall.Web)
|
||||||
|
# Tags de release : v* (ex. v1.0.0). Le prefix 'v' est le defaut de GitVersion,
|
||||||
|
# inutile de le declarer (bug GitVersion 6.8.1 : tag-prefix personnalise + aucun
|
||||||
|
# tag existant => "Failed to parse next-version"). L'agent utilise
|
||||||
|
# GitVersion.Agent.yml (tags agent-v*), cycle de release independant.
|
||||||
|
workflow: TrunkBased/preview1
|
||||||
|
next-version: 1.0.0
|
||||||
|
assembly-informational-format: '{MajorMinorPatch}+{BranchName}.{ShortSha}'
|
||||||
@@ -42,6 +42,24 @@ docker-reset: ## Stop and remove everything
|
|||||||
|
|
||||||
deploy: docker-build docker-up ## Build and deploy
|
deploy: docker-build docker-up ## Build and deploy
|
||||||
|
|
||||||
|
# ─── Versioning / Release (GitVersion) ──────────────────────────
|
||||||
|
|
||||||
|
version: ## Show GitVersion versions (central + agent)
|
||||||
|
@export PATH="$$PATH:$$HOME/.dotnet/tools"; \
|
||||||
|
if ! command -v dotnet-gitversion >/dev/null 2>&1; then dotnet tool install --global GitVersion.Tool --version 6.8.1 >/dev/null; fi; \
|
||||||
|
echo "Central (GitVersion.yml):"; \
|
||||||
|
dotnet-gitversion -config GitVersion.yml -output json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(' SemVer:', d['SemVer'], '| MajorMinorPatch:', d['MajorMinorPatch'])" 2>/dev/null || echo " (erreur — pas de tag v* ?)"; \
|
||||||
|
echo "Agent (GitVersion.Agent.yml):"; \
|
||||||
|
dotnet-gitversion -config GitVersion.Agent.yml -output json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(' SemVer:', d['SemVer'], '| MajorMinorPatch:', d['MajorMinorPatch'])" 2>/dev/null || echo " (erreur — pas de tag agent-v* ? bug GitVersion tag-prefix)"
|
||||||
|
|
||||||
|
version-tag: ## Tag la version courante (usage: make version-tag TAG=v1.0.0)
|
||||||
|
@test -n "$(TAG)" || (echo "Usage: make version-tag TAG=v1.0.0"; exit 1); \
|
||||||
|
git tag "$(TAG)" && git push origin "$(TAG)"
|
||||||
|
|
||||||
|
version-tag-agent: ## Tag la version agent (usage: make version-tag-agent TAG=agent-v1.0.0)
|
||||||
|
@test -n "$(TAG)" || (echo "Usage: make version-tag-agent TAG=agent-v1.0.0"; exit 1); \
|
||||||
|
git tag "$(TAG)" && git push origin "$(TAG)"
|
||||||
|
|
||||||
# ─── Database ────────────────────────────────────────────────────
|
# ─── Database ────────────────────────────────────────────────────
|
||||||
|
|
||||||
migration-add: ## Add a new EF migration (usage: make migration-add NAME=xxx)
|
migration-add: ## Add a new EF migration (usage: make migration-add NAME=xxx)
|
||||||
|
|||||||
Reference in new issue
Block a user