This is a 5-minute excerpt from our August 2020 Community Office Hours webinar where we cover workflows, a new feature in Garden 0.12. A recording of the entire webinar is available here.
Workflows are a new top-level config type in Garden, like modules and projects. They consist of steps, where each step is either a Garden command or a custom script. These steps are run sequentially and can be skipped via a boolean template expression, and step configs can use outputs from previous steps in template strings.
As for the motivation behind the feature: workflows make it possible to define and run a continuous sequence made up of both Garden commands and custom scripts, such as how to connect to infrastructure before a deploy or what steps should be taken after a build is finished. Using workflows, a user can run the same sequence of steps locally and in CI, making integration tests easy to run consistently both pre- and post-commit.
Sample use cases include:
- Using a script step to download and prepare files
- Running tasks before or after tests (e.g. to populate test data)
- Implementing custom logic for publishing artefacts (e.g. a Docker image or test artefacts)