-
-
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.
Imported variant command's globals (top-level parameters and options) are now merged into the command, when it misses parameters and options with the same names. If any imported global's type conflict with the command's corresponding parameter/option type, it fails early so that the imported command doesn't fail due to unexpected value/type provided. Resolves #29
- Loading branch information
Showing
11 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
examples/advanced/nested-import-global-propagation-default/lib/lib.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,16 @@ | ||
option "project-dir" { | ||
description = "Terraform projects directory" | ||
default = "./defaultdir" | ||
type = string | ||
} | ||
|
||
job "terraform plan" { | ||
parameter "project" { | ||
type = string | ||
} | ||
|
||
exec { | ||
command = "bash" | ||
args = ["-c", "echo ${opt.project-dir}/${param.project}"] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
examples/advanced/nested-import-global-propagation-default/main.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,3 @@ | ||
job "nested" { | ||
import = "lib" | ||
} |
16 changes: 16 additions & 0 deletions
16
examples/advanced/nested-import-global-propagation-incompatible-type/lib/lib.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,16 @@ | ||
option "project-dir" { | ||
description = "Terraform projects directory" | ||
default = "./defaultdir" | ||
type = string | ||
} | ||
|
||
job "terraform plan" { | ||
parameter "project" { | ||
type = string | ||
} | ||
|
||
exec { | ||
command = "bash" | ||
args = ["-c", "echo ${opt.project-dir}/${param.project}"] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
examples/advanced/nested-import-global-propagation-incompatible-type/main.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,10 @@ | ||
option "project-dir" { | ||
# The default works from geodesic shell `projects` folder | ||
default = 1 | ||
description = "Terraform projects directory" | ||
type = number | ||
} | ||
|
||
job "nested" { | ||
import = "lib" | ||
} |
1 change: 1 addition & 0 deletions
1
examples/advanced/nested-import-global-propagation/defaultdir/project
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 @@ | ||
DEFAULT |
16 changes: 16 additions & 0 deletions
16
examples/advanced/nested-import-global-propagation/lib/lib.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,16 @@ | ||
option "project-dir" { | ||
description = "Terraform projects directory" | ||
default = "./defaultdir" | ||
type = string | ||
} | ||
|
||
job "terraform plan" { | ||
parameter "project" { | ||
type = string | ||
} | ||
|
||
exec { | ||
command = "bash" | ||
args = ["-c", "echo ${opt.project-dir}/${param.project}"] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
examples/advanced/nested-import-global-propagation/main.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,10 @@ | ||
option "project-dir" { | ||
# The default works from geodesic shell `projects` folder | ||
default = "./overridedir" | ||
description = "Terraform projects directory" | ||
type = string | ||
} | ||
|
||
job "nested" { | ||
import = "lib" | ||
} |
1 change: 1 addition & 0 deletions
1
examples/advanced/nested-import-global-propagation/overridedir/project
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 @@ | ||
OVERRIDE |
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
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