All checks were successful
Deploy Prefect Flows / deploy (push) Successful in 50s
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
"""
|
|
Script de déploiement des flows vers Prefect.
|
|
"""
|
|
|
|
from prefect import flow
|
|
from prefect.runner.storage import GitRepository
|
|
|
|
|
|
def main():
|
|
"""Déploie tous les flows."""
|
|
|
|
# Source Git pour le code des flows
|
|
source = GitRepository(
|
|
url="https://gitea.arnodo.fr/Damien/prefect-flows-pg-backup.git",
|
|
branch="main",
|
|
)
|
|
|
|
# Déploiement du flow de backup depuis le repository Git
|
|
flow.from_source(
|
|
source=source,
|
|
entrypoint="flows/backup.py:pg_backup",
|
|
).deploy(
|
|
name="pg-backup-daily",
|
|
work_pool_name="pg-backup-pool",
|
|
cron="0 2 * * *", # Tous les jours à 2h du matin
|
|
parameters={
|
|
"pg_host": "postgresql.taila5ad8.ts.net",
|
|
"pg_port": 5432,
|
|
"pg_database": "netbox",
|
|
"pg_user": "netbox",
|
|
"pg_password": "", # À définir via l'UI ou variables
|
|
"s3_bucket": "postgres-backup",
|
|
"s3_prefix": "netbox",
|
|
"aws_credentials_block": "garage-credentials",
|
|
},
|
|
tags=["backup", "postgresql", "netbox"],
|
|
)
|
|
|
|
print("✅ Deployment completed!")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|