Skip to content

Commit 66dad26

Browse files
Rearrange step schema (#182)
* Move step description and outputs under mixin
1 parent f59eec1 commit 66dad26

File tree

23 files changed

+186
-156
lines changed

23 files changed

+186
-156
lines changed

build/testdata/bundles/hello/porter.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ version: 0.1.0
66
invocationImage: porter-hello:latest
77

88
install:
9-
- description: "Say Hello"
10-
exec:
9+
- exec:
10+
description: "Say Hello"
1111
command: bash
1212
arguments:
1313
- -c
1414
- echo Hello World
1515

1616
uninstall:
17-
- description: "Say Goodbye"
18-
exec:
17+
- exec:
18+
description: "Say Goodbye"
1919
command: bash
2020
arguments:
2121
- -c

build/testdata/bundles/mysql/porter.yaml

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ parameters:
2121
env: MYSQL_USER
2222

2323
install:
24-
- description: "Install MySQL"
25-
helm:
24+
- helm:
25+
description: "Install MySQL"
2626
name: porter-ci-mysql
2727
chart: stable/mysql
2828
version: 0.10.2
@@ -32,15 +32,15 @@ install:
3232
source: bundle.parameters.database-name
3333
mysqlUser:
3434
source: bundle.parameters.mysql-user
35-
outputs:
36-
- name: mysql-root-password
37-
secret: porter-ci-mysql
38-
key: mysql-root-password
39-
- name: mysql-password
40-
secret: porter-ci-mysql
41-
key: mysql-password
35+
outputs:
36+
- name: mysql-root-password
37+
secret: porter-ci-mysql
38+
key: mysql-root-password
39+
- name: mysql-password
40+
secret: porter-ci-mysql
41+
key: mysql-password
4242
uninstall:
43-
- description: "Uninstall MySQL"
44-
helm:
43+
- helm:
44+
description: "Uninstall MySQL"
4545
name: porter-ci-mysql
4646
purge: true

build/testdata/bundles/wordpress/porter.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ parameters:
2323
env: WORDPRESS_NAME
2424

2525
install:
26-
- description: "Install Wordpress"
27-
helm:
26+
- helm:
27+
description: "Install Wordpress"
2828
name:
2929
source: bundle.parameters.wordpress-name
3030
chart: stable/wordpress
@@ -40,7 +40,7 @@ install:
4040
source: bundle.dependencies.mysql.outputs.mysql-password
4141

4242
uninstall:
43-
- description: "Uninstall Wordpress"
44-
helm:
43+
- helm:
44+
description: "Uninstall Wordpress"
4545
name:
4646
source: bundle.parameters.wordpress-name

docs/content/build-image.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ version: "0.1.0"
2424
invocationImage: porter-hello:latest
2525

2626
install:
27-
- description: "Install Hello World"
28-
exec:
27+
- exec:
28+
description: "Install Hello World"
2929
command: bash
3030
arguments:
3131
- -c
3232
- echo Hello World
3333

3434
uninstall:
35-
- description: "Uninstall Hello World"
36-
exec:
35+
- exec:
36+
description: "Uninstall Hello World"
3737
command: bash
3838
arguments:
3939
- -c
@@ -192,14 +192,14 @@ credentials:
192192
path: /root/.kube/config
193193

194194
install:
195-
- description: "Install MySQL"
196-
helm:
195+
- helm:
196+
description: "Install MySQL"
197197
name: porter-ci-mysql
198198
chart: stable/mysql
199199
version: "0.10.2"
200200
uninstall:
201-
- description: "Uninstall MySQL"
202-
helm:
201+
- helm:
202+
description: "Uninstall MySQL"
203203
name: porter-ci-mysql
204204
purge: true
205205
```
@@ -285,16 +285,16 @@ dependencies:
285285
mysql_user: wordpress
286286
287287
install:
288-
- description: "Say Hello"
289-
exec:
288+
- exec:
289+
description: "Say Hello"
290290
command: bash
291291
arguments:
292292
- -c
293293
- echo Hello World
294294
295295
uninstall:
296-
- description: "Say Goodbye"
297-
exec:
296+
- exec:
297+
description: "Say Goodbye"
298298
command: bash
299299
arguments:
300300
- -c

docs/content/docs.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ credentials:
3434
path: /root/.kube/config
3535

3636
install:
37-
- description: "Install MySQL"
38-
helm:
37+
- helm:
38+
description: "Install MySQL"
3939
name: mydb
4040
chart: stable/mysql
4141
version: 0.10.2
4242
replace: true
4343
set:
4444
mysqlDatabase: mydb
45-
outputs:
46-
- name: "MYSQL_HOST"
47-
key: "MYSQL_HOST"
45+
outputs:
46+
- name: "MYSQL_HOST"
47+
key: "MYSQL_HOST"
4848

4949
uninstall:
50-
- description: "Uninstall MySQL"
51-
helm:
50+
- helm:
51+
description: "Uninstall MySQL"
5252
name: mydb
5353
purge: true
5454
```

docs/content/mixin-architecture.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ version: 0.1.0
2222
invocationImage: porter-hello:latest
2323

2424
install:
25-
- description: "Say Hello"
26-
exec:
25+
- exec:
26+
description: "Say Hello"
2727
command: bash
2828
arguments:
2929
- -c
@@ -85,17 +85,17 @@ Use "helm [command] --help" for more information about a command.
8585
Porter will pass the entire step, in YAML form, to the mixin. Porter expects the step YAML to have a `description` field and an array of optional `outputs`, and allows each mixin to process the remaining structure of the YAML as needed. For example, the `helm` mixin expects to be passed a YAML document like this:
8686

8787
```yaml
88+
helm:
8889
description: "Install MySQL"
89-
helm:
90-
name: porter-ci-mysql
91-
chart: stable/mysql
92-
version: 0.10.2
93-
replace: true
94-
set:
95-
mysqlDatabase:
96-
source: bundle.parameters.database-name
97-
mysqlUser:
98-
source: bundle.parameters.mysql-user
90+
name: porter-ci-mysql
91+
chart: stable/mysql
92+
version: 0.10.2
93+
replace: true
94+
set:
95+
mysqlDatabase:
96+
source: bundle.parameters.database-name
97+
mysqlUser:
98+
source: bundle.parameters.mysql-user
9999
outputs:
100100
- name: mysql-root-password
101101
secret: porter-ci-mysql

docs/content/porter-or-duffle.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ parameters:
7777
default: mywordpress
7878

7979
install:
80-
- description: "Install MySQL"
81-
helm:
80+
- helm:
81+
description: "Install MySQL"
8282
name: mywordpress-mysql
8383
chart: stable/mysql
8484
set:
@@ -93,8 +93,8 @@ install:
9393
- name: dbpassword
9494
secret: mywordpress-mysql
9595
key: mysql-password
96-
- description: "Install Wordpress"
97-
helm:
96+
- helm:
97+
description: "Install Wordpress"
9898
name:
9999
source: bundle.parameters.wordpress-name
100100
chart: stable/wordpress
@@ -108,8 +108,8 @@ install:
108108
source: bundle.outputs.dbpassword
109109

110110
uninstall:
111-
- description: "Uninstall Wordpress Helm Chart"
112-
helm:
111+
- helm:
112+
description: "Uninstall Wordpress Helm Chart"
113113
name:
114114
source: bundle.parameters.wordpress-name
115115
```
@@ -188,14 +188,14 @@ parameters:
188188
default: mydb
189189
190190
install:
191-
- description: "Install MySQL"
192-
helm:
191+
- helm:
192+
description: "Install MySQL"
193193
name: mysql
194194
chart: stable/mysql
195195
set:
196196
mysqlDatabase:
197197
source: bundle.parameters.database_name
198-
outputs:
198+
outputs:
199199
- name: dbhost
200200
secret: mysql
201201
key: mysql-host
@@ -231,8 +231,8 @@ credentials:
231231
path: /root/.kube/config
232232
233233
install:
234-
- description: "Install Wordpress"
235-
helm:
234+
- helm:
235+
description: "Install Wordpress"
236236
name:
237237
source: bundle.parameters.wordpress-name
238238
chart: stable/wordpress

examples/azure-ark/porter.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ parameters:
3737
default: porterdemocontainer
3838

3939
install:
40-
- description: "Create Azure Storage Account and Container"
41-
azure:
40+
- azure:
41+
description: "Create Azure Storage Account and Container"
4242
type: storage
4343
name: porter-azure-ark
4444
resourceGroup:
@@ -50,12 +50,12 @@ install:
5050
source: bundle.parameters.storage_account_name
5151
storageContainerName:
5252
source: bundle.parameters.storage_container_name
53-
outputs:
54-
- name: "STORAGE_ACCOUNT_KEY"
55-
key: "STORAGE_ACCOUNT_KEY"
53+
outputs:
54+
- name: "STORAGE_ACCOUNT_KEY"
55+
key: "STORAGE_ACCOUNT_KEY"
5656

57-
- description: "Helm Install Ark"
58-
helm:
57+
- helm:
58+
description: "Helm Install Ark"
5959
name: porter-azure-ark
6060
chart: stable/ark
6161
replace: true
@@ -83,6 +83,6 @@ install:
8383
configuration.backupStorageProvider.bucket:
8484
source: bundle.parameters.storage_container_name
8585
uninstall:
86-
- description: "Uninstall Ark"
87-
azure:
86+
- azure:
87+
description: "Uninstall Ark"
8888
name: porter-azure-ark

examples/azure-mysql-wordpress/porter.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ parameters:
3232
default: "wordpress"
3333

3434
install:
35-
- description: "Create Azure MySQL"
36-
azure:
35+
- azure:
36+
description: "Create Azure MySQL"
3737
type: mysql
3838
name: mysql-azure-porter-demo-wordpress
3939
resourceGroup: "porter-test"
@@ -48,12 +48,12 @@ install:
4848
sslEnforcement: "Disabled"
4949
databaseName:
5050
source: bundle.parameters.database_name
51-
outputs:
52-
- name: "MYSQL_HOST"
53-
key: "MYSQL_HOST"
51+
outputs:
52+
- name: "MYSQL_HOST"
53+
key: "MYSQL_HOST"
5454

55-
- description: "Helm Install Wordpress"
56-
helm:
55+
- helm:
56+
description: "Helm Install Wordpress"
5757
name: porter-ci-wordpress
5858
chart: stable/wordpress
5959
replace: true
@@ -70,8 +70,8 @@ install:
7070
externalDatabase.database:
7171
source: bundle.parameters.database_name
7272
uninstall:
73-
- description: "Uninstall Wordpress"
74-
azure:
73+
- azure:
74+
description: "Uninstall Wordpress"
7575
name: porter-ci-wordpress
7676

7777

0 commit comments

Comments
 (0)