--watch|-w
flag or when running garden dev
.garden run task <task-name>
command. This will run the task regardless of whether or not the result is cached.garden get task-result <task-name>
.postgresql
Helm chart. The module has a task for initializing the database and another one for clearing it. In the example we use environment variables to set the password. Notice also that the tasks depend on the postgres
service being deployed.container
module type instead of Helm charts.container
, exec
and helm
, allow you to extract artifacts after tasks have been run. This can be handy when you'd like to view reports or logs, or if you'd like a script (via a local exec
module, for instance) to validate the output from a task.artifacts
field on task configurations. For example, for the container
module, you can do something like this:my-task
, you can find the contents of the report
directory in the task's container, locally under .garden/artifacts/my-task-report
.disabled: true
in the task configuration. You can also disable them conditionally using template strings. For example, to disable a container
module task for a specific environment, you could do something like this:--var
CLI flag to pass in values to the task. Here for example, we have a simple container task that can receive an argument via a variable:<project-name--metadata>
namespace with the format task-result--<hash>
.exec
module type runs tasks locally in your shell. By default, the exec
module type executes tasks in the Garden build directory (under .garden/build/<module-name>
). By setting local: true
, the tasks are executed in the module source directory instead.serviceResource
needs to be specified to determine the pod spec for the task pod. You can see the whole pod spec used in the reference docs for kubernetes and helm modules. Please note that the startupProbe
, livenessProbe
and readinessProbe
are stripped from your pod spec. Health checks for your application might fail when the container is used for testing because the main process usually running in that container is replaced by the task command.