Skip to content

Commit

Permalink
doc: Add environment variables to the YAML reference
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathonReinhart committed Sep 9, 2018
1 parent a6a9037 commit 456144d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions doc/yaml-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ Example:
image: debian:8.2
```
### `environment`

The optional `environment` node allows environment variables to be specified.
This can be either a mapping (dictionary), or a list of `KEY=VALUE` pairs.
If a value is not specified, the value is taken from the external environment.

Examples:
```yaml
environment:
FOO: "This is foo"
SECRET:
```
```yaml
environment:
- FOO=This is foo
- SECRET
```


### `aliases`

The optional `aliases` node is a mapping (dictionary) of bash-like aliases,
Expand Down Expand Up @@ -53,6 +72,21 @@ aliases:
- cat /etc/os-release
```

Aliases can add to the top-level `environment` and override its values using
the same syntax:
```yaml
environment:
FOO: "Top-level"
aliases:
example:
environment:
FOO: "Override"
BAR: "New"
script:
- echo $FOO $BAR
```


### `hooks`

The optional `hooks` node is a mapping (dictionary) of "hook" scripts that run
Expand Down

0 comments on commit 456144d

Please sign in to comment.