LogoLogo
Bonsai (0.13) DocsGitHubDiscord CommunityGarden Enterprise
Bonsai (0.13)
Bonsai (0.13)
  • Welcome to Garden!
  • 🌸Overview
    • How Garden Works
    • Core Concepts
    • Adopting Garden
    • Garden vs Other Tools
  • 🌳Use Cases
    • Isolated On-Demand Preview Environments
    • Fast, Portable CI Pipelines that Run Anywhere
    • Shift Testing Left
    • Local Development With Remote Clusters
    • Jumpstart your Internal Developer Platform
  • 🌻Getting Started
    • Quickstart Guide
    • Installing Garden
    • Next Steps
  • 💐Tutorials
    • Your First Project
      • 1. Create a Garden Project
      • 2. Pick a Kubernetes Plugin
      • 3. Add Actions
      • 4. Add Tests
      • 5. Code Syncing (Hot Reload)
      • 6. Next Steps
  • 🌿Using Garden
    • About
    • Configuration Overview
    • Projects
    • Dashboard
    • Actions
    • Tests
    • Runs
    • Workflows
    • Variables and templating
    • Config Templates
    • Using the CLI
    • Modules
  • Kubernetes Plugins
    • About
    • Remote K8s Plugin Configuration
      • 1. Create a Cluster
        • AWS
        • GCP
        • Azure
      • 2. Configure Container Registry
        • AWS
        • GCP
        • Azure
        • Docker Hub
      • 3. Set Up Ingress, TLS and DNS
      • 4. Configure the Provider
    • Local K8s Plugin Configuration
      • 1. Install Local Kubernetes
      • 2. Configure the Provider
    • Ephemeral K8s Plugin Configuration
      • 1. Configure the Provider
      • 2. Login to the Garden dashboard
      • 3. Configure Ingress (optional)
      • 4. Retrieve Kubeconfig (optional)
    • Actions
      • Build
        • Container
      • Deploy
        • Kubernetes
        • Helm
        • Container
        • PersistentVolumeClaim
        • ConfigMap
      • Run and Test
        • Kubernetes Pod
        • Helm Pod
        • Kubernetes Exec
        • Container
    • Guides
      • In-Cluster Building
      • Minimal RBAC Configuration for Development Clusters
      • Deploying to Production
      • Using a Registry Mirror
  • ☘️Terraform Plugin
    • About
    • Plugin Configuration
    • Actions
  • 🌹Pulumi Plugin
    • About
    • Plugin Configuration
    • Actions
  • 🌼Other Plugins
    • Container
    • Exec (local scripts)
  • 🌷Guides
    • Migrating to Bonsai
    • Migrating from Docker Compose to Garden
    • Deprecations and updating to Cedar
    • Code Synchronization
    • Connecting a local application to a Kubernetes cluster (Local Mode)
    • Environments and namespaces
    • Using Garden in CircleCI
  • 🪷Advanced
    • Using Remote Sources
    • Custom Commands
  • 🎋Reference
    • Providers
      • conftest-container
      • conftest-kubernetes
      • conftest
      • container
      • ephemeral-kubernetes
      • exec
      • hadolint
      • jib
      • kubernetes
      • local-kubernetes
      • octant
      • otel-collector
      • pulumi
      • terraform
    • Action Types
      • Build
        • container Build
        • exec Build
        • jib-container Build
      • Deploy
        • configmap Deploy
        • container Deploy
        • exec Deploy
        • helm Deploy
        • kubernetes Deploy
        • persistentvolumeclaim Deploy
        • pulumi Deploy
        • terraform Deploy
      • Run
        • container Run
        • exec Run
        • helm-pod Run
        • kubernetes-exec Run
        • kubernetes-pod Run
      • Test
        • conftest-helm Test
        • conftest Test
        • container Test
        • exec Test
        • hadolint Test
        • helm-pod Test
        • kubernetes-exec Test
        • kubernetes-pod Test
    • Template Strings
      • Project template context
      • Environment template context
      • Provider template context
      • Action (all fields) template context
      • Action spec template context
      • Module template context
      • Remote Source template context
      • Project Output template context
      • Custom Command template context
      • Workflow template context
      • Template Helper Functions
    • Commands
    • Project Configuration
    • ConfigTemplate Reference
    • RenderTemplate Reference
    • Workflow Configuration
    • Garden Containers on Docker Hub
    • Module Template Configuration
    • Module Types
      • configmap
      • conftest
      • container
      • exec
      • hadolint
      • helm
      • jib-container
      • kubernetes
      • persistentvolumeclaim
      • pulumi
      • templated
      • terraform
  • 🌸Misc
    • FAQ
    • Troubleshooting
    • Telemetry
    • New Garden Cloud Version
  • Contributing to Garden
    • Contributor Covenant Code of Conduct
    • Contributing to the Docs
    • Setting up your developer environment
    • Developing Garden
    • Config resolution
    • Graph execution
Powered by GitBook
On this page
  • ${local.*}
  • ${local.artifactsPath}
  • ${local.env.*}
  • ${local.env.<env-var-name>}
  • ${local.arch}
  • ${local.platform}
  • ${local.projectPath}
  • ${local.username}
  • ${local.usernameLowerCase}
  • ${command.*}
  • ${command.name}
  • ${command.params.*}
  • ${command.params.<name>}
  • ${datetime.*}
  • ${datetime.now}
  • ${datetime.today}
  • ${datetime.timestamp}
  • ${project.*}
  • ${project.name}
  • ${git.*}
  • ${git.branch}
  • ${git.commitHash}
  • ${git.originUrl}
  • ${secrets.*}
  • ${secrets.<secret-name>}
  • ${variables.*}
  • ${variables.<variable-name>}
  • ${var.*}
  • ${var.<name>}
  • ${environment.*}
  • ${environment.name}
  • ${environment.fullName}
  • ${environment.namespace}
  • ${inputs.*}
  • ${inputs.<input-key>}
  • ${parent.*}
  • ${parent.name}
  • ${template.*}
  • ${template.name}
  • ${steps.*}
  • ${steps.<step-name>.log}
  • ${steps.<step-name>.outputs.*}
  • ${steps.<step-name>.outputs.<output-key>}

Was this helpful?

  1. Reference
  2. Template Strings

Workflow template context

PreviousCustom Command template contextNextTemplate Helper Functions

Last updated 14 days ago

Was this helpful?

The below keys are available in template strings for configurations, as well as the commands defined in .

Note that the {steps.*} key is only available for the steps[].command and steps[].script fields in Workflow configs, and may only reference previous steps in the same workflow. See below for more details.

${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:

my-variable: ${local.artifactsPath}

${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.arch}

A string indicating the architecture that the framework is running on (see https://nodejs.org/api/process.html#process_process_arch)

Type

string

Example:

my-variable: ${local.arch}

${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:

my-variable: ${local.platform}

${local.projectPath}

The absolute path to the project root directory.

Type

string

Example:

my-variable: ${local.projectPath}

${local.username}

The current username (as resolved by https://github.com/sindresorhus/username).

Type

string

Example:

my-variable: ${local.username}

${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:

my-variable: ${local.usernameLowerCase}

${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 "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:

my-variable: ${command.name}

${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.

Option values can be referenced by the option's default name (e.g. local-mode) or its alias (e.g. local) 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:

my-variable: ${datetime.now}

${datetime.today}

The current UTC date, at time of template resolution, in ISO-8601 format.

Type

string

Example:

my-variable: ${datetime.today}

${datetime.timestamp}

The current UTC Unix timestamp (in seconds), at time of template resolution.

Type

string

Example:

my-variable: ${datetime.timestamp}

${project.*}

Information about the Garden project.

Type

object

${project.name}

The name of the Garden project.

Type

string

Example:

my-variable: ${project.name}

${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:

my-variable: ${git.branch}

${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:

my-variable: ${git.commitHash}

${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:

my-variable: ${git.originUrl}

${secrets.*}

A map of all secrets for this project in the current environment.

Type

object

${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 | number | boolean | link | array[link]

${var.*}

Alias for the variables field.

Type
Default

object

{}

${var.<name>}

Number, string or boolean

Type

string | number | boolean

${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:

my-variable: ${environment.name}

${environment.fullName}

The full name of the environment Garden is running against, including the namespace.

Type

string

Example:

my-variable: ${environment.fullName}

${environment.namespace}

The currently active namespace (if any).

Type

string

Example:

my-variable: ${environment.namespace}

${inputs.*}

The inputs provided to the config through a template, if applicable.

Type
Default

object

{}

${inputs.<input-key>}

Type

string | number | boolean | link | array[link]

${parent.*}

Information about the config parent, if any (usually a template, if applicable).

Type

object

${parent.name}

The name of the parent config.

Type

string

${template.*}

Information about the template used when generating the config, if applicable.

Type

object

${template.name}

The name of the template.

Type

string

${steps.*}

Reference previous steps in a workflow. Only available in the steps[].command and steps[].script fields. The name of the step should be the explicitly set name of the other step, or if one is not set, usestep-<n>, where is the sequential number of the step (starting from 1).

Type
Default

object

{}

${steps.<step-name>.log}

The full output log from the step.

Type

string

${steps.<step-name>.outputs.*}

The outputs returned by the step, as a mapping. Script steps will always have stdout, stderr and exitCode keys. Command steps return different keys, including potentially nested maps and arrays. Please refer to each command for its output schema.

Type
Default

object

{}

${steps.<step-name>.outputs.<output-key>}

Type

string | number | boolean | link | array[link]

🎋
Workflow
Custom Commands