env Provider
ℹ️
Introduced in Togomak v1.0.0
The data.env provider fetches variables from the host runtime environment.
Example
togomak {
version = 2
}
data "env" "home" {
key = "HOME"
default = "nowhere"
}
stage "hello" {
script = "echo my home is ${data.env.home.value}"
}Usage
The data.env block accepts the following arguments:
-
default- Optional, specifies the fallback value if the key specified inkeydoes not exist. In the case where thekeydoes not exist in the host environment, and if thedefaultargument is not defined, thedata.envprovider will return an error. -
key- Required,
Arguments Reference
key: The environment variable key which needs to be fetched fromos.environdefault: Fallback definition, which will be returned ifos.environ[key]is undefined.
Attributes Reference
- [
value]: The value from the environment variable defined inkey