feat: add deployment script
This commit is contained in:
33
deploy.py
Normal file
33
deploy.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
"""
|
||||||
|
Script de déploiement des flows vers Prefect.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from flows.backup import pg_backup
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Déploie tous les flows."""
|
||||||
|
|
||||||
|
# Déploiement du flow de backup
|
||||||
|
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": "backups",
|
||||||
|
"s3_prefix": "postgresql/netbox",
|
||||||
|
"aws_credentials_block": "garage-credentials",
|
||||||
|
},
|
||||||
|
tags=["backup", "postgresql", "netbox"],
|
||||||
|
)
|
||||||
|
|
||||||
|
print("✅ Deployment completed!")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user