glamorous-kangaroo-20427
01/06/2025, 7:22 PMmicroscopic-river-74022
01/06/2025, 7:22 PMmicroscopic-river-74022
01/06/2025, 7:22 PM${environment.name}
template string. This allows you to reference the name of the environment Garden is running against, excluding the namespace.
Here's an example of how you can use it:
yaml
my-variable: ${environment.name}
This template string is available in various contexts within Garden, including:
- Module template context
- Provider template context
- Action (all fields) template context
- Workflow template context
- Remote Source template context
- Action spec template context
You can use this to dynamically set values based on the current environment. For instance, you might use it to set different configuration values for different environments:
yaml
kind: Deploy
spec:
env:
LOG_LEVEL: ${var.log-level} # <- resolves to "debug" for the "local" environment, "info" for the "remote" env
In this example, the LOG_LEVEL
environment variable is set based on the current environment, as defined in the project configuration.
For more detailed information on variables and templating in Garden, you can refer to the [Variables and templating]() documentation.
[Using Garden > Variables and templating > Project variables]() provides more examples of how to use variables and templating in your Garden configuration.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
01/06/2025, 7:22 PMglamorous-kangaroo-20427
01/06/2025, 7:24 PMmicroscopic-river-74022
01/06/2025, 7:24 PMmicroscopic-river-74022
01/06/2025, 7:25 PM${environment.name}
template string, which refers to the name of the environment Garden is running against, not actual environment variables set in the system.
To accurately answer your question about accessing environment variables within Garden templating, I would need additional information that is not present in the given knowledge sources.
If you're looking for information on how to access system environment variables in Garden configurations, this might involve a different syntax or method that is not covered in the provided documentation snippets.
For the most accurate and up-to-date information on this topic, I recommend checking the official Garden documentation or reaching out to Garden support channels. I apologize that I cannot provide a more specific answer based on the current knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
01/06/2025, 7:25 PM