Searchโ€ฆ
Project Output configuration context
The below keys are available in template strings for project outputs, specified in outputs[].value keys in project config files. These include all the keys from the sections above.
Output values can reference outputs defined by providers, via the ${providers.<provider-name>.outputs} key. For details on which outputs are available for a given provider, please refer to the reference docs for the provider in question, and look for the Outputs section.
Output values may also reference outputs defined by modules, via the ${modules.<module-name>.outputs} key, as well as service and task outputs via the ${runtime.services.<service-name>.outputs} and ${runtime.tasks.<task-name>.outputs} keys.
For details on which outputs are available for a given module type, please refer to the reference docs for the module type in question, and look for the Outputs section.

${local.*}

Context variables that are specific to the currently running environment/machine.
Type
object

${local.artifactsPath}

The absolute path to the directory where exported artifacts from test and task runs are stored.
Type
string
Example:
1
my-variable: ${local.artifactsPath}
Copied!

${local.env.*}

A map of all local environment variables (see https://nodejs.org/api/process.html#process_process_env).
Type
object

${local.env.<env-var-name>}

The environment variable value.
Type
string

${local.platform}

A string indicating the platform that the framework is running on (see https://nodejs.org/api/process.html#process_process_platform)
Type
string
Example:
1
my-variable: ${local.platform}
Copied!

${local.projectPath}

The absolute path to the project root directory.
Type
string
Example:
1
my-variable: ${local.projectPath}
Copied!

${local.username}

The current username (as resolved by https://github.com/sindresorhus/username).
Type
string
Example:
1
my-variable: ${local.username}
Copied!

${local.usernameLowerCase}

The current username (as resolved by https://github.com/sindresorhus/username), with any upper case characters converted to lower case.
Type
string
Example:
1
my-variable: ${local.usernameLowerCase}
Copied!

${command.*}

Information about the currently running command and its arguments.
Type
object

${command.name}

The currently running Garden CLI command, without positional arguments or option flags. This can be handy to e.g. change some variables based on whether you're running garden test or some other specific command.
Note that this will currently always resolve to "run workflow" when running Workflows, as opposed to individual workflow step commands. This may be revisited at a later time, but currently all configuration is resolved once for all workflow steps.
Type
string
Example:
1
my-variable: ${command.name}
Copied!

${command.params.*}

A map of all parameters set when calling the current command. This includes both positional arguments and option flags, and includes any default values set by the framework or specific command. This can be powerful if used right, but do take care since different parameters are only available in certain commands, some have array values etc.
For example, to see if a service is in hot-reload mode, you might do something like ${command.params contains 'hot-reload' && command.params.hot-reload contains 'my-service'}. Notice that you currently need to check both for the existence of the parameter, and also to correctly handle the array value.
Option values can be referenced by the option's default name (e.g. dev-mode) or its alias (e.g. dev) if one is defined for that option.
Type
object

${command.params.<name>}

Type
any

${datetime.*}

Information about the date/time at template resolution time.
Type
object

${datetime.now}

The current UTC date and time, at time of template resolution, in ISO-8601 format.
Type
string
Example:
1
my-variable: ${datetime.now}
Copied!

${datetime.today}

The current UTC date, at time of template resolution, in ISO-8601 format.
Type
string
Example:
1
my-variable: ${datetime.today}
Copied!

${datetime.timestamp}

The current UTC Unix timestamp (in seconds), at time of template resolution.
Type
string
Example:
1
my-variable: ${datetime.timestamp}
Copied!

${project.*}

Information about the Garden project.
Type
object

${project.name}

The name of the Garden project.
Type
string
Example:
1
my-variable: ${project.name}
Copied!

${git.*}

Information about the current state of the project's Git repository.
Type
object

${git.branch}

The current Git branch, if available. Resolves to an empty string if HEAD is in a detached state (e.g. when rebasing), or if the repository has no commits.
When using remote sources, the branch used is that of the project/top-level repository (the one that contains the project configuration).
The branch is resolved at the start of the Garden command's execution, and is not updated if the current branch changes during the command's execution (which could happen, for example, when using watch-mode commands).
Type
string
Example:
1
my-variable: ${git.branch}
Copied!

${git.commitHash}

The current Git commit hash, if available. Resolves to an empty string if the repository has no commits.
When using remote sources, the hash used is that of the project/top-level repository (the one that contains the project configuration).
The hash is resolved at the start of the Garden command's execution, and is not updated if the current commit changes during the command's execution (which could happen, for example, when using watch-mode commands).
Type
string
Example:
1
my-variable: ${git.commitHash}
Copied!

${git.originUrl}

The remote origin URL of the project Git repository.
When using remote sources, the URL is that of the project/top-level repository (the one that contains the project configuration).
Type
string
Example:
1
my-variable: ${git.originUrl}
Copied!

${secrets.<secret-name>}

The secret's value.
Type
string

${variables.*}

A map of all variables defined in the project configuration, including environment-specific variables.
Type
Default
object
{}

${variables.<variable-name>}

Type
`string

${var.*}

Alias for the variables field.
Type
Default
object
{}

${var.<name>}

Number, string or boolean
Type
`string

${environment.*}

Information about the environment that Garden is running against.
Type
object

${environment.name}

The name of the environment Garden is running against, excluding the namespace.
Type
string
Example:
1
my-variable: ${environment.name}
Copied!

${environment.fullName}

The full name of the environment Garden is running against, including the namespace.
Type
string
Example:
1
my-variable: ${environment.fullName}
Copied!

${environment.namespace}

The currently active namespace (if any).
Type
string
Example:
1
my-variable: ${environment.namespace}
Copied!

${providers.*}

Retrieve information about providers that are defined in the project.
Type
Default
object
{}

${providers.<provider-name>.config.*}

The resolved configuration for the provider.
Type
object

${providers.<provider-name>.config.<config-key>}

The provider config key value. Refer to individual provider references for details.
Type
`string

${providers.<provider-name>.outputs.*}

The outputs defined by the provider (see individual plugin docs for details).
Type
Default
object
{}

${providers.<provider-name>.outputs.<output-key>}

The provider output value. Refer to individual provider references for details.
Type
`string

${modules.*}

Retrieve information about modules that are defined in the project.
Type
Default
object
{}

${modules.<module-name>.buildPath}

The build path of the module.
Type
string
Example:
1
my-variable: ${modules.<module-name>.buildPath}
Copied!

${modules.<module-name>.name}

The name of the module.
Type
string

${modules.<module-name>.path}

The local path of the module.
Type
string
Example:
1
my-variable: ${modules.<module-name>.path}
Copied!

${modules.<module-name>.outputs.*}

The outputs defined by the module (see individual module type references for details).
Type
Default
object
{}

${modules.<module-name>.outputs.<output-name>}

The module output value. Refer to individual module type references for details.
Type
`string

${modules.<module-name>.var.*}

A map of all variables defined in the module.
Type
Default
object
{}

${modules.<module-name>.var.<variable-name>}

Type
`string

${modules.<module-name>.version}

The current version of the module.
Type
string
Example:
1
my-variable: ${modules.<module-name>.version}
Copied!

${runtime.*}

Runtime outputs and information from services and tasks (only resolved at runtime when deploying services and running tasks).
Type
object

${runtime.services.*}

Runtime information from the services that the service/task being run depends on.
Type
Default
object
{}

${runtime.services.<service-name>.outputs.*}

The runtime outputs defined by the service (see individual module type references for details).
Type
Default
object
{}

${runtime.services.<service-name>.outputs.<output-name>}

The service output value. Refer to individual module type references for details.
Type
`string

${runtime.services.<service-name>.version}

The current version of the service.
Type
string
Example:
1
my-variable: ${runtime.services.<service-name>.version}
Copied!

${runtime.tasks.*}

Runtime information from the tasks that the service/task being run depends on.
Type
Default
object
{}

${runtime.tasks.<task-name>.outputs.*}

The runtime outputs defined by the task (see individual module type references for details).
Type
Default
object
{}

${runtime.tasks.<task-name>.outputs.<output-name>}

The task output value. Refer to individual module type references for details.
Type
`string

${runtime.tasks.<task-name>.version}

The current version of the task.
Type
string
Example:
1
my-variable: ${runtime.tasks.<task-name>.version}
Copied!