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.
89 lines
1.9 KiB
89 lines
1.9 KiB
3 years ago
|
# Variables File
|
||
|
|
||
2 years ago
|
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.
|
||
3 years ago
|
|
||
2 years ago
|
Unlike a steps file, the INI format is currently the only supported format for a variables file.
|
||
3 years ago
|
|
||
|
## 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.
|
||
|
|
||
2 years ago
|
```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
|
||
|
```
|
||
|
|
||
3 years ago
|
## 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
|
||
|
|
||
2 years ago
|
Any other variable defined in the section is dynamically available. These are not used by Script Tease, but implementers may find this feature useful.
|
||
3 years ago
|
|
||
|
```ini
|
||
|
[domain_name]
|
||
|
value: example.app
|
||
|
other: test
|
||
|
```
|
||
|
|
||
|
The value of `other` is `test`.
|