-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #661 from k1LoW/include-vars
Listing variable expansion patterns in the Include runner.
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
desc: Include vars (included) | ||
if: included | ||
steps: | ||
- | ||
test: | | ||
// If it is a primitive type, the value is passed as it is. | ||
vars.a == 12345 | ||
&& vars.b == "54321" | ||
// If there is a variable expansion, it is reinterpreted in a form without quotes. | ||
&& vars.c == 12345 | ||
&& vars.d == 54321 | ||
&& vars.e == 123459 | ||
&& vars.f == 543219 | ||
&& vars.g == 912345 | ||
&& vars.h == 954321 | ||
// If cast with string(), it is treated as a string. | ||
&& vars.i == "12345" | ||
&& vars.j == "54321" | ||
// If the expanded value is to be passed as a string, enclose it in double quotes. | ||
&& vars.k == "123459" | ||
&& vars.l == "543219" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
desc: Include vars (main) | ||
vars: | ||
intNumber: 12345 | ||
strNumber: "54321" | ||
steps: | ||
- | ||
include: | ||
path: include_vars_included.yml | ||
vars: | ||
# If it is a primitive type, the value is passed as it is. | ||
a: 12345 | ||
b: "54321" | ||
# If there is a variable expansion, it is reinterpreted in a form without quotes. | ||
c: '{{ vars.intNumber }}' | ||
d: '{{ vars.strNumber }}' | ||
e: '{{ vars.intNumber }}9' | ||
f: '{{ vars.strNumber }}9' | ||
g: '9{{ vars.intNumber }}' | ||
h: '9{{ vars.strNumber }}' | ||
# If cast with string(), it is treated as a string. | ||
i: '{{ string(vars.intNumber) }}' | ||
j: '{{ string(vars.strNumber) }}' | ||
# If the expanded value is to be passed as a string, enclose it in double quotes. | ||
k: '"{{ vars.intNumber }}9"' | ||
l: '"{{ vars.strNumber }}9"' |