Skip to content

Commit 673e6cb

Browse files
committed
docs: more updates in the substitutions sections
Signed-off-by: mbshields <[email protected]>
1 parent 8bdbc03 commit 673e6cb

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docs/reference/stacker_file.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ During a stacker build, the behavior of stacker is specified by yaml directives
44

55
## Substitutions and variables
66

7-
In the yaml directives, stacker allows variable substitions of several forms. For example, these three substition statements:
7+
Before parsing the yaml directives, stacker performs substitions on any variable placeholders of the format `${{VAR}}` or `${{VAR:default}}` in the directives. For example, when a stacker build is run with this command:
88

9-
$ONE ${{TWO}} ${{THREE:3}}
9+
`stacker build --substitute ONE=1`
1010

11-
when run with `stacker build --substitute ONE=1 --substitute TWO=2` are
12-
processed by stacker as:
11+
these variable placeholders:
1312

14-
1 2 3
13+
${{ONE}} ${{TWO:3}}
14+
15+
are replaced by stacker with these values:
16+
17+
1 3
1518

1619
In order to avoid conflict with bash or POSIX shells in the `run` section, only placeholders with two braces are supported, e.g. `${{FOO}}`. Placeholders with a default value like `${{FOO:default}}` will evaluate to their default if not specified on the command line or in a substitution file.
1720

docs/user_guide/template_substitution.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Template Variable Substitution
22

3-
In the yaml directives that direct a stacker build, stacker allows variable substitions of several forms. For example, these three substition statements:
3+
Before parsing the yaml directives that direct a stacker build, stacker performs substitions on any variable placeholders of the format `${{VAR}}` or `${{VAR:default}}` in the directives. For example, when a stacker build is run with this command:
44

5-
$ONE ${{TWO}} ${{THREE:3}}
5+
`stacker build --substitute ONE=1`
66

7-
when run with `stacker build --substitute ONE=1 --substitute TWO=2` are
8-
processed by stacker as:
7+
these variable placeholders:
98

10-
1 2 3
9+
${{ONE}} ${{TWO:3}}
10+
11+
are replaced by stacker with these values:
12+
13+
1 3
1114

1215
In order to avoid conflict with bash or POSIX shells in the `run` section, only placeholders with two braces are supported, such as `${{FOO}}`. Placeholders with a default value like `${{FOO:default}}` will evaluate to their default if not specified on the command line or in a substitution file.
1316

0 commit comments

Comments
 (0)