44 lines
933 B
Markdown
44 lines
933 B
Markdown
# Prefect Flows - PostgreSQL Backup
|
|
|
|
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
|
|
|
|
```
|
|
prefect-flows-pg-backup/
|
|
├── flows/
|
|
│ └── backup.py # Flow principal de backup
|
|
├── deploy.py # Script de déploiement
|
|
├── requirements.txt
|
|
└── README.md
|
|
```
|
|
|
|
## Déploiement manuel
|
|
|
|
```bash
|
|
export PREFECT_API_URL=https://prefect.taila5ad8.ts.net/api
|
|
python deploy.py
|
|
```
|
|
|
|
## Déploiement automatique
|
|
|
|
Le workflow Gitea Actions déploie automatiquement les flows sur push vers `main`.
|