Hello, I've been deploying using YAML files via th...
# prefect-cloud
b
Hello, I've been deploying using YAML files via the CLI to Prefect Cloud. I noticed that when I remove a deployment from the YAML and redeploy, the deployment still exists in Prefect Cloud. Does anyone know if there's a way to automatically delete deployments that are no longer in the YAML file during re-deployment? Thanks!
j
I don’t believe that feature exists. You can implement a solution with ci/cd that could accomplish this though
I could imagine this being problematic as a default behavior if for example two developers were working on the same flow using different branches
b
Thanks for the quick reply. I'm actually deploying via a CI/CD pipeline already, and the goal is to have deployments only when they come directly from that pipeline. I agree that making this a default behavior could be problematic. However, having a flag for this functionality would be useful for use-cases like mine. Are you thinking of in the CI/CD running the
Copy code
prefect deployment delete
command manually for each?
j
Yes, I'm sure you can script out some logic that runs that runs
prefect deployment ls
to grab existing deployments and then deletes the deployments not found in your prefect yaml
I don't have a working example of it, I wonder if someone already implemented this before
🙌 1
b
Howdy! Were you able to find an example of someone else doing this?
120 Views