Refactoring
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## 📋 Vue d'Ensemble
|
||||
|
||||
Ce guide décrit le processus de déploiement de l'API AfterWork sur le VPS via `lionesctl pipeline`.
|
||||
Ce guide décrit le processus de déploiement de l'API AfterWork sur le VPS via `lionsctl pipeline`.
|
||||
|
||||
**URL de l'API** : `https://api.lions.dev/afterwork`
|
||||
|
||||
@@ -14,7 +14,7 @@ Ce guide décrit le processus de déploiement de l'API AfterWork sur le VPS via
|
||||
- Java 17 (JDK)
|
||||
- Maven 3.9+
|
||||
- Docker 20.10+
|
||||
- `lionesctl` CLI installé et configuré
|
||||
- `lionsctl` CLI installé et configuré
|
||||
|
||||
### Environnement Serveur
|
||||
- PostgreSQL 15+
|
||||
@@ -86,31 +86,66 @@ docker push registry.lions.dev/afterwork-api:latest
|
||||
|
||||
---
|
||||
|
||||
## 🚢 Déploiement avec lionesctl
|
||||
## 🚢 Déploiement avec lionsctl pipeline
|
||||
|
||||
### Commande de Déploiement
|
||||
La commande **`lionsctl pipeline`** clone le repo Git, compile (Maven), construit l'image Docker, déploie sur Kubernetes et envoie une notification email. Il n'y a pas de sous-commande `deploy` : tout est inclus dans `lionsctl pipeline`.
|
||||
|
||||
### Commande de déploiement
|
||||
|
||||
Remplacez `<org>` par votre organisation Git (ex. `lionsdev`, `developer`) et `<email>` par l'adresse de notification.
|
||||
|
||||
```bash
|
||||
# Déploiement via lionesctl pipeline
|
||||
lionesctl pipeline deploy \
|
||||
--app afterwork-api \
|
||||
--image registry.lions.dev/afterwork-api:1.0.0 \
|
||||
--namespace applications \
|
||||
--port 8080 \
|
||||
--replicas 2
|
||||
# Déploiement en dev (clone + build + image + déploiement K8s)
|
||||
lionsctl pipeline \
|
||||
-u https://git.lions.dev/<org>/mic-after-work-server-impl-quarkus-main \
|
||||
-b develop \
|
||||
-j 17 \
|
||||
-e dev \
|
||||
-c k1 \
|
||||
-m <email>
|
||||
|
||||
# Ou avec le fichier de configuration
|
||||
lionesctl pipeline deploy -f kubernetes/afterwork-deployment.yaml
|
||||
# Déploiement en production sur le cluster k2
|
||||
lionsctl pipeline \
|
||||
-u https://git.lions.dev/<org>/mic-after-work-server-impl-quarkus-main \
|
||||
-b main \
|
||||
-j 17 \
|
||||
-e production \
|
||||
-c k2 \
|
||||
-m <email> \
|
||||
-p prod
|
||||
|
||||
# Avec déploiement Helm (charts générés automatiquement)
|
||||
lionsctl pipeline \
|
||||
-u https://git.lions.dev/<org>/mic-after-work-server-impl-quarkus-main \
|
||||
-b develop \
|
||||
-j 17 \
|
||||
-e dev \
|
||||
-c k1 \
|
||||
-m <email> \
|
||||
--use-helm
|
||||
```
|
||||
|
||||
### Vérification du Déploiement
|
||||
**Options principales :**
|
||||
|
||||
| Option | Description | Exemple |
|
||||
|--------|-------------|---------|
|
||||
| `-u`, `--url` | URL du repo Git (obligatoire) | `https://git.lions.dev/.../mic-after-work-server-impl-quarkus-main` |
|
||||
| `-b`, `--branch` | Branche à déployer | `develop`, `main` |
|
||||
| `-j`, `--java-version` | Version Java (8–21) | `17` |
|
||||
| `-e`, `--environment` | Environnement (dev / staging / production) | `dev`, `production` |
|
||||
| `-c`, `--cluster` | Cluster Kubernetes (k1 ou k2) (obligatoire) | `k1`, `k2` |
|
||||
| `-m`, `--mail` | Email(s) pour les notifications | `admin@lions.dev` |
|
||||
| `-p`, `--profile` | Profil Maven | `prod` pour production |
|
||||
| `--use-helm` | Déployer via Helm | — |
|
||||
|
||||
### Vérification du déploiement
|
||||
|
||||
```bash
|
||||
# Status du déploiement
|
||||
lionesctl pipeline status --app afterwork-api
|
||||
# Pods et statut (nom d'app dérivé du repo, ex. mic-after-work-server-impl-quarkus-main)
|
||||
kubectl get pods -n applications -l app=mic-after-work-server-impl-quarkus-main
|
||||
|
||||
# Logs en temps réel
|
||||
lionesctl pipeline logs --app afterwork-api --follow
|
||||
kubectl logs -n applications -l app=mic-after-work-server-impl-quarkus-main -f
|
||||
|
||||
# Health check
|
||||
curl https://api.lions.dev/afterwork/q/health/ready
|
||||
@@ -325,8 +360,8 @@ kubectl apply -f kubernetes/afterwork-deployment.yaml
|
||||
kubectl apply -f kubernetes/afterwork-service.yaml
|
||||
kubectl apply -f kubernetes/afterwork-ingress.yaml
|
||||
|
||||
# Ou via lionesctl pipeline
|
||||
lionesctl pipeline deploy -f kubernetes/
|
||||
# Ou via lionsctl pipeline (clone + build + déploiement)
|
||||
lionsctl pipeline -u https://git.lions.dev/<org>/mic-after-work-server-impl-quarkus-main -b develop -j 17 -e dev -c k1 -m <email>
|
||||
```
|
||||
|
||||
### Étape 5 : Vérification
|
||||
|
||||
Reference in New Issue
Block a user