%%{init: {
"theme": "base",
"themeVariables": {
"background": "#F7F9FC",
"primaryTextColor": "#2F2F2F",
"lineColor": "#B8C4CC",
"fontFamily": "Inter, Arial"
}
}}%%
graph TB
%% ===== Subgraphs =====
subgraph S1["🌱 Stage 1: Build"]
A[Checkout Code] --> B[Restore Cache]
B --> C[Maven Build]
end
subgraph S2["🧪 Stage 2: Test"]
C --> D[Tests Unitaires]
C --> E[Tests Intégration]
C --> F[Analyse Code]
end
subgraph S3["📦 Stage 3: Package"]
D & E & F --> G[Build Docker Image]
G --> H[Scan Sécurité]
end
subgraph S4["🚀 Stage 4: Deploy"]
H --> I[Push Registry]
I --> J{Env ?}
J -->|Dev| K[Deploy Dev]
J -->|Staging| L[Deploy Staging]
J -->|Prod| M[Deploy Prod]
end
%% ===== Classes =====
classDef build fill:#CDE7F0,stroke:#9FC7D8,stroke-width:1px,color:#2F2F2F
classDef test fill:#DFF2E1,stroke:#A8D5B5,stroke-width:1px,color:#2F2F2F
classDef package fill:#FFF1D6,stroke:#E5CFA3,stroke-width:1px,color:#2F2F2F
classDef deploy fill:#EAD7F5,stroke:#C7A9E3,stroke-width:1px,color:#2F2F2F
classDef decision fill:#FBE6F2,stroke:#E0AFCB,stroke-width:1px,color:#2F2F2F
%% ===== Apply classes =====
class A,B,C build
class D,E,F test
class G,H package
class I,K,L,M deploy
class J decision
%% ===== Subgraph styling (IMPORTANT) =====
style S1 fill:#EEF7FB,stroke:#9FC7D8,stroke-width:2px
style S2 fill:#EFF9F1,stroke:#A8D5B5,stroke-width:2px
style S3 fill:#FFF7E6,stroke:#E5CFA3,stroke-width:2px
style S4 fill:#F6EEFB,stroke:#C7A9E3,stroke-width:2px