Can I cleanup deploys automatically ?
# 🤖|ask-kapa
s
@microscopic-river-74022 Can I cleanup deploys automatically ?
m
Please stand by @swift-island-27000 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- Yes, Garden provides commands to clean up deployments. The
garden cleanup deploy
command cleans up running deployments or services if using modules. It un-deploys the specified actions and cleans up all deploys/services in the project if no arguments are provided. However, this command does not take into account any deploys depending on the cleaned up actions, and might therefore leave the project in an unstable state. Running
garden deploy
after will re-deploy anything missing. Here are some examples:
Copy code
bash
garden cleanup deploy my-service # deletes my-service
garden cleanup deploy            # deletes all deployed services in the project
You can also use the
--dependants-first
option to clean up Deploys (or services if using modules) in reverse dependency order. That is, if service-a has a dependency on service-b, service-a will be deleted before service-b. Moreover, the
--with-dependants
option allows you to also clean up deployments/services that have dependencies on one of the deployments/services specified as CLI arguments (recursively). Please note that these commands should be used with caution to avoid unintentional destruction of services, especially in production or shared environments. For more details, please refer to the Garden documentation (). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted