You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
1.9 KiB
88 lines
1.9 KiB
# Variables File
|
|
|
|
A variables file contains variable definitions that may be used as the context for parsing a [steps file](steps-file.md) *before* the actual commands are generated.
|
|
|
|
Unlike a steps file, the INI format is currently the only supported format for a variables file.
|
|
|
|
## The Variable Name
|
|
|
|
The variable name is defined in the section:
|
|
|
|
```ini
|
|
[domain_name]
|
|
value: example.com
|
|
```
|
|
|
|
## The Variable Value
|
|
|
|
As seen in the example above, the value is defined by simply adding a variable parameter:
|
|
|
|
```ini
|
|
[domain_name]
|
|
value: example.com
|
|
|
|
[database_host]
|
|
value: db1.example.com
|
|
```
|
|
|
|
!!! note
|
|
|
|
This is the minimum definition for all variables.
|
|
|
|
## Defining An Environment
|
|
|
|
You may define an environment for any given variable that may be used for filtering variables. This is done by adding the environment name to the variable name:
|
|
|
|
```ini
|
|
[database_host:development]
|
|
value: localhost
|
|
|
|
[database_host:live]
|
|
value: db1.example.com
|
|
```
|
|
|
|
In this way, variables of the same name may be supported across different deployment environments.
|
|
|
|
## Adding Comments
|
|
|
|
As demonstrated in the example above, you may comment on a variable by adding a `comment:` attribute to the section.
|
|
|
|
```ini
|
|
[database_host:testing]
|
|
comment: Local host used when testing.
|
|
value: localhost
|
|
|
|
[database_host:live]
|
|
comment: Separate server used when live.
|
|
value: db1.example.com
|
|
```
|
|
|
|
## Defining Tags
|
|
|
|
Tags may be defined for any variable as a comma separated list. This is useful for filtering.
|
|
|
|
```ini
|
|
[database_host:development]
|
|
value: localhost
|
|
tags: database
|
|
|
|
[database_host:live]
|
|
value: db1.example.com
|
|
tags: database
|
|
|
|
[domain_name]
|
|
value: example.app
|
|
tags: application
|
|
```
|
|
|
|
## Other Attributes
|
|
|
|
Any other variable defined in the section is dynamically available. These are not used by Script Tease, but implementers may find this feature useful.
|
|
|
|
```ini
|
|
[domain_name]
|
|
value: example.app
|
|
other: test
|
|
```
|
|
|
|
The value of `other` is `test`.
|
|
|