docs: document Gitea secrets for CI/CD

This commit is contained in:
2026-01-31 16:35:53 +00:00
parent 032b91d5b3
commit 86ee6111a3

View File

@@ -2,24 +2,6 @@
Flows Prefect pour la sauvegarde automatisée de bases PostgreSQL vers S3 (Garage). Flows Prefect pour la sauvegarde automatisée de bases PostgreSQL vers S3 (Garage).
## Prérequis
### Prefect Blocks
Configurer les blocks suivants dans Prefect UI ou via code :
```python
from prefect_aws import AwsCredentials
# Credentials S3 pour Garage
creds = AwsCredentials(
aws_access_key_id="xxx",
aws_secret_access_key="xxx",
aws_endpoint_url="https://s3.taila5ad8.ts.net"
)
creds.save("garage-credentials")
```
## Structure ## Structure
``` ```
@@ -27,17 +9,46 @@ prefect-flows-pg-backup/
├── flows/ ├── flows/
│ └── backup.py # Flow principal de backup │ └── backup.py # Flow principal de backup
├── deploy.py # Script de déploiement ├── deploy.py # Script de déploiement
├── setup_blocks.py # Création des Prefect Blocks
├── requirements.txt ├── requirements.txt
└── README.md └── README.md
``` ```
## Déploiement automatique (CI/CD)
Le workflow Gitea Actions crée les Blocks et déploie les flows automatiquement sur push vers `main`.
### Secrets requis dans Gitea
Dans **Settings → Secrets**, ajouter :
| Secret | Description |
|--------|-------------|
| `PREFECT_API_URL` | `https://prefect.taila5ad8.ts.net/api` |
| `S3_ACCESS_KEY` | Access key Garage |
| `S3_SECRET_KEY` | Secret key Garage |
| `S3_ENDPOINT_URL` | `https://s3.taila5ad8.ts.net` |
## Déploiement manuel ## Déploiement manuel
```bash ```bash
export PREFECT_API_URL=https://prefect.taila5ad8.ts.net/api export PREFECT_API_URL=https://prefect.taila5ad8.ts.net/api
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_ENDPOINT_URL=https://s3.taila5ad8.ts.net
python setup_blocks.py
python deploy.py python deploy.py
``` ```
## Déploiement automatique ## Blocks créés
Le workflow Gitea Actions déploie automatiquement les flows sur push vers `main`. | Block | Type | Usage |
|-------|------|-------|
| `garage-credentials` | `AwsCredentials` | Credentials S3 pour Garage |
## Flows déployés
| Flow | Schedule | Description |
|------|----------|-------------|
| `pg-backup-daily` | `0 2 * * *` | Backup quotidien à 2h |