ancient-island-74119
09/02/2025, 6:38 PMkind: Command
name: cleanup-all
description:
short: Cleans up all environments (preview in the current project configuration)
gardenCommand:
- cleanup
- deploy
- app,app2
- "&&"
- cleanup
- namespace
The other option might be to create 2 custom commands and then call that command (similar to a Makefile target), but this would require 3 custom commands. I am trying to avoid that.microscopic-river-74022
09/02/2025, 6:38 PMmicroscopic-river-74022
09/02/2025, 6:38 PMkind: Command
name: cleanup-all
description:
short: Cleans up deploys and then the namespace
exec:
command:
- sh
- -c
- |
garden cleanup deploy app,app2 && garden cleanup namespace
This leverages the allowed exec step before any gardenCommand ([Custom Commands]()).
- Alternatively, define a Workflow with two command steps, which runs multiple Garden commands in sequence and is generally more efficient than scripting separate CLI calls:
kind: Workflow
name: cleanup-all
steps:
- command: [cleanup, deploy, app,app2]
- command: [cleanup, namespace]
Then run with garden workflow cleanup-all ([Workflows]()).microscopic-river-74022
09/02/2025, 6:38 PMmicroscopic-river-74022
09/02/2025, 6:38 PM