Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: more updates in the substitutions sections #55

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/reference/stacker_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ During a stacker build, the behavior of stacker is specified by yaml directives

## Substitutions and variables

In the yaml directives, stacker allows variable substitions of several forms. For example, these three substition statements:
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:

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

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

1 2 3
${{ONE}} ${{TWO:3}}

are replaced by stacker with these values:

1 3

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.

Expand Down
13 changes: 8 additions & 5 deletions docs/user_guide/template_substitution.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Template Variable Substitution

In the yaml directives that direct a stacker build, stacker allows variable substitions of several forms. For example, these three substition statements:
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:

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

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

1 2 3
${{ONE}} ${{TWO:3}}

are replaced by stacker with these values:

1 3

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.

Expand Down
Loading