-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THis fixes the issue of broken indirect run args when there were two or more types of values in the object being passed as args. Ref https://sweetops.slack.com/archives/CFFQ9GFB5/p1587009393226000
- Loading branch information
Showing
5 changed files
with
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
order: | ||
- foo | ||
- bar |
50 changes: 50 additions & 0 deletions
50
examples/issues/cant-convert-go-str-to-bool/example.variant
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,50 @@ | ||
job "deploy switch" { | ||
option "dry-run" { | ||
type = bool | ||
} | ||
|
||
option "item" { | ||
type = string | ||
} | ||
|
||
option "tenant" { | ||
type = string | ||
} | ||
|
||
exec { | ||
command = "bash" | ||
args = ["-c", "echo deploy switch tenant=${opt.tenant} item=${opt.item}"] | ||
} | ||
} | ||
|
||
job "example" { | ||
config "file" { | ||
source file { | ||
path = "${context.sourcedir}/conf.yaml" | ||
} | ||
} | ||
|
||
option "dry-run" { | ||
type = bool | ||
default = false | ||
} | ||
|
||
parameter "tenant" { | ||
type = string | ||
default = "mytenant" | ||
} | ||
|
||
depends_on "deploy switch" { | ||
items = conf.file.order | ||
args = { | ||
dry-run = opt.dry-run | ||
item = item | ||
tenant = param.tenant | ||
} | ||
} | ||
|
||
exec { | ||
command = "bash" | ||
args = ["-c", "echo Done."] | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
examples/issues/cant-convert-go-str-to-bool/example_test.variant
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,22 @@ | ||
test "example" { | ||
case "ok" { | ||
out = trimspace(<<EOS | ||
deploy switch tenant=mytenant item=foo | ||
deploy switch tenant=mytenant item=bar | ||
Done. | ||
EOS | ||
) | ||
exitstatus = 0 | ||
} | ||
|
||
run "example" { | ||
} | ||
|
||
assert "out" { | ||
condition = run.res.stdout == case.out | ||
} | ||
|
||
assert "exitstatus" { | ||
condition = run.res.exitstatus == case.exitstatus | ||
} | ||
} |
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