Environment
The Environment
is used to define environment variables.
These variables can be used for templating and are passed to commands when they are executed.
Name | Required | Default | Type | Description |
---|---|---|---|---|
name | yes | - | String | Human readable name of the Environment |
system | no | [] | List of String | List of variables to copy from the system |
inherits | no | [] | List of String | List of other Environments to copy variables from |
sources | no | [] | List of String | List of .env files to copy from |
values | no | {} | Map of String to String | Map of string-value variables |
Environments have four sources of variables: system system
, parent environments inherits
, .env files sources
and a key-value map values
These sources have a specific order in which they are loaded and overwritten.
We call this order "precedence", and the last one in the order has the highest precedence.
The order in which the variables are loaded is the following:
system
the given list of environment variables are loaded in the defined order
inherits
the given list of environment names are loaded in the defined order
the variables from the first environment are loaded first and are overwritten by the values of all following environments
the variables from the last environment overwrite all prior-loaded variables, so it has the highest precedence.
sources
the given list of
.env
files is loaded in the defined orderall variables loaded from files overwrite variables that are copied from inherits
the variables from the first file are loaded first and are overwritten by the values of all following files
the variables from the last file overwrite all prior-loaded variables, so it has the highest precedence.
values
values is a key-value map with string keys and string values
any defined value overwrites variables that where copied from sources or inherits
values always have the highest precedence
Example: