-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add collapse test for nesting orbs and local commands, etc
- Loading branch information
Zachary Scott
committed
Jun 22, 2018
1 parent
998a258
commit fa63a02
Showing
9 changed files
with
239 additions
and
1 deletion.
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
File renamed without changes.
112 changes: 112 additions & 0 deletions
112
cmd/testdata/nested-orbs-and-local-commands-etc/result.yml
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,112 @@ | ||
commands: | ||
foo: | ||
parameters: | ||
mybool: | ||
default: true | ||
type: boolean | ||
steps: | ||
- run: echo in foo | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- run: echo bool is true | ||
- unless: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- run: echo bool is false | ||
say: | ||
description: A simple command that echoes whatever is passed | ||
parameters: | ||
saywhat: | ||
description: What shall we say? | ||
type: string | ||
steps: | ||
- run: echo << parameters.saywhat >> | ||
executors: | ||
parallel: | ||
parallelism: 4 | ||
jobs: | ||
bar: | ||
machine: | ||
docker_layer_caching: << parameters.mybool >> | ||
enabled: << parameters.mybool >> | ||
parameters: | ||
mybool: | ||
default: false | ||
type: boolean | ||
myotherbool: | ||
default: false | ||
type: boolean | ||
mysteps: | ||
default: [] | ||
type: steps | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- << parameters.mysteps >> | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- foo: | ||
mybool: << parameters.myotherbool >> | ||
build-false: | ||
machine: true | ||
steps: | ||
- foo: | ||
mybool: false | ||
build-true: | ||
machine: true | ||
steps: | ||
- foo | ||
sayhello: | ||
description: A job that does very little other than demonstrate what a parameterized | ||
job looks like | ||
machine: true | ||
parameters: | ||
saywhat: | ||
default: World | ||
description: To whom shall we say hello? | ||
type: string | ||
steps: | ||
- say: | ||
saywhat: Hello << parameters.saywhat >> | ||
orbs: | ||
foo: | ||
commands: | ||
zomg: | ||
description: a command inside a folder in an orb | ||
parameters: | ||
tm: | ||
description: Tell me something. | ||
type: string | ||
steps: | ||
- run: echo "You don't say... << parameters.saywhat >>" | ||
description: A simple encapsulation of common tasks in Hugo | ||
executors: | ||
default: | ||
docker: | ||
- image: cibuilds/hugo:<< parameters.image >> | ||
parameters: | ||
tag: | ||
description: The tag to use on the image | ||
type: string | ||
version: 2 | ||
workflows: | ||
version: 2 | ||
workflow: | ||
jobs: | ||
- build-true | ||
- build-false | ||
- bar: | ||
mybool: true | ||
myotherbool: false | ||
- bar: | ||
mybool: false | ||
myotherbool: true | ||
- bar: | ||
mybool: true | ||
mysteps: | ||
- run: echo i am a steps param, hear me shout | ||
|
71 changes: 71 additions & 0 deletions
71
cmd/testdata/nested-orbs-and-local-commands-etc/test/build.yml
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,71 @@ | ||
version: 2 | ||
|
||
commands: | ||
foo: | ||
parameters: | ||
mybool: | ||
type: boolean | ||
default: true | ||
steps: | ||
- run: "echo in foo" | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- run: echo bool is true | ||
- unless: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- run: echo bool is false | ||
|
||
jobs: | ||
build-true: | ||
machine: true | ||
steps: | ||
- foo | ||
build-false: | ||
machine: true | ||
steps: | ||
- foo: | ||
mybool: false | ||
bar: | ||
parameters: | ||
mybool: | ||
type: boolean | ||
default: false | ||
myotherbool: | ||
type: boolean | ||
default: false | ||
mysteps: | ||
type: steps | ||
default: [] | ||
machine: | ||
docker_layer_caching: << parameters.mybool >> | ||
enabled: << parameters.mybool >> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- << parameters.mysteps >> | ||
- when: | ||
condition: << parameters.mybool >> | ||
steps: | ||
- foo: | ||
mybool: << parameters.myotherbool >> | ||
|
||
workflows: | ||
version: 2 | ||
workflow: | ||
jobs: | ||
- build-true | ||
- build-false | ||
- bar: | ||
mybool: true | ||
myotherbool: false | ||
- bar: | ||
mybool: false | ||
myotherbool: true | ||
- bar: | ||
mybool: true | ||
mysteps: | ||
- run: echo i am a steps param, hear me shout |
8 changes: 8 additions & 0 deletions
8
cmd/testdata/nested-orbs-and-local-commands-etc/test/commands/say.yml
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,8 @@ | ||
description: "A simple command that echoes whatever is passed" | ||
parameters: | ||
saywhat: | ||
description: "What shall we say?" | ||
type: string | ||
steps: | ||
# note: the interpolation syntax is subject to change | ||
- run: echo << parameters.saywhat >> |
1 change: 1 addition & 0 deletions
1
cmd/testdata/nested-orbs-and-local-commands-etc/test/executors/parallel.yml
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 @@ | ||
parallelism: 4 |
10 changes: 10 additions & 0 deletions
10
cmd/testdata/nested-orbs-and-local-commands-etc/test/jobs/sayhello.yml
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 @@ | ||
description: A job that does very little other than demonstrate what a parameterized job looks like | ||
parameters: | ||
saywhat: | ||
description: "To whom shall we say hello?" | ||
type: string | ||
default: "World" | ||
machine: true | ||
steps: | ||
- say: | ||
saywhat: Hello << parameters.saywhat >> |
7 changes: 7 additions & 0 deletions
7
cmd/testdata/nested-orbs-and-local-commands-etc/test/orbs/foo/commands/zomg.yml
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,7 @@ | ||
description: "a command inside a folder in an orb" | ||
parameters: | ||
tm: | ||
description: "Tell me something." | ||
type: string | ||
steps: | ||
- run: echo "You don't say... << parameters.saywhat >>" |
10 changes: 10 additions & 0 deletions
10
cmd/testdata/nested-orbs-and-local-commands-etc/test/orbs/foo/orb.yml
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 @@ | ||
description: "A simple encapsulation of common tasks in Hugo" | ||
|
||
executors: | ||
default: | ||
parameters: | ||
tag: | ||
description: "The tag to use on the image" | ||
type: string | ||
docker: | ||
- image: cibuilds/hugo:<< parameters.image >> |