Skip to content

Commit

Permalink
Rearrange step schema (#182)
Browse files Browse the repository at this point in the history
* Move step description and outputs under mixin
  • Loading branch information
carolynvs-msft committed Feb 25, 2019
1 parent f59eec1 commit 66dad26
Show file tree
Hide file tree
Showing 23 changed files with 186 additions and 156 deletions.
8 changes: 4 additions & 4 deletions build/testdata/bundles/hello/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ version: 0.1.0
invocationImage: porter-hello:latest

install:
- description: "Say Hello"
exec:
- exec:
description: "Say Hello"
command: bash
arguments:
- -c
- echo Hello World

uninstall:
- description: "Say Goodbye"
exec:
- exec:
description: "Say Goodbye"
command: bash
arguments:
- -c
Expand Down
22 changes: 11 additions & 11 deletions build/testdata/bundles/mysql/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ parameters:
env: MYSQL_USER

install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: porter-ci-mysql
chart: stable/mysql
version: 0.10.2
Expand All @@ -32,15 +32,15 @@ install:
source: bundle.parameters.database-name
mysqlUser:
source: bundle.parameters.mysql-user
outputs:
- name: mysql-root-password
secret: porter-ci-mysql
key: mysql-root-password
- name: mysql-password
secret: porter-ci-mysql
key: mysql-password
outputs:
- name: mysql-root-password
secret: porter-ci-mysql
key: mysql-root-password
- name: mysql-password
secret: porter-ci-mysql
key: mysql-password
uninstall:
- description: "Uninstall MySQL"
helm:
- helm:
description: "Uninstall MySQL"
name: porter-ci-mysql
purge: true
8 changes: 4 additions & 4 deletions build/testdata/bundles/wordpress/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ parameters:
env: WORDPRESS_NAME

install:
- description: "Install Wordpress"
helm:
- helm:
description: "Install Wordpress"
name:
source: bundle.parameters.wordpress-name
chart: stable/wordpress
Expand All @@ -40,7 +40,7 @@ install:
source: bundle.dependencies.mysql.outputs.mysql-password

uninstall:
- description: "Uninstall Wordpress"
helm:
- helm:
description: "Uninstall Wordpress"
name:
source: bundle.parameters.wordpress-name
24 changes: 12 additions & 12 deletions docs/content/build-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ version: "0.1.0"
invocationImage: porter-hello:latest

install:
- description: "Install Hello World"
exec:
- exec:
description: "Install Hello World"
command: bash
arguments:
- -c
- echo Hello World

uninstall:
- description: "Uninstall Hello World"
exec:
- exec:
description: "Uninstall Hello World"
command: bash
arguments:
- -c
Expand Down Expand Up @@ -192,14 +192,14 @@ credentials:
path: /root/.kube/config

install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: porter-ci-mysql
chart: stable/mysql
version: "0.10.2"
uninstall:
- description: "Uninstall MySQL"
helm:
- helm:
description: "Uninstall MySQL"
name: porter-ci-mysql
purge: true
```
Expand Down Expand Up @@ -285,16 +285,16 @@ dependencies:
mysql_user: wordpress

install:
- description: "Say Hello"
exec:
- exec:
description: "Say Hello"
command: bash
arguments:
- -c
- echo Hello World

uninstall:
- description: "Say Goodbye"
exec:
- exec:
description: "Say Goodbye"
command: bash
arguments:
- -c
Expand Down
14 changes: 7 additions & 7 deletions docs/content/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ credentials:
path: /root/.kube/config

install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: mydb
chart: stable/mysql
version: 0.10.2
replace: true
set:
mysqlDatabase: mydb
outputs:
- name: "MYSQL_HOST"
key: "MYSQL_HOST"
outputs:
- name: "MYSQL_HOST"
key: "MYSQL_HOST"

uninstall:
- description: "Uninstall MySQL"
helm:
- helm:
description: "Uninstall MySQL"
name: mydb
purge: true
```
Expand Down
24 changes: 12 additions & 12 deletions docs/content/mixin-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ version: 0.1.0
invocationImage: porter-hello:latest

install:
- description: "Say Hello"
exec:
- exec:
description: "Say Hello"
command: bash
arguments:
- -c
Expand Down Expand Up @@ -85,17 +85,17 @@ Use "helm [command] --help" for more information about a command.
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:

```yaml
helm:
description: "Install MySQL"
helm:
name: porter-ci-mysql
chart: stable/mysql
version: 0.10.2
replace: true
set:
mysqlDatabase:
source: bundle.parameters.database-name
mysqlUser:
source: bundle.parameters.mysql-user
name: porter-ci-mysql
chart: stable/mysql
version: 0.10.2
replace: true
set:
mysqlDatabase:
source: bundle.parameters.database-name
mysqlUser:
source: bundle.parameters.mysql-user
outputs:
- name: mysql-root-password
secret: porter-ci-mysql
Expand Down
22 changes: 11 additions & 11 deletions docs/content/porter-or-duffle.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ parameters:
default: mywordpress

install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: mywordpress-mysql
chart: stable/mysql
set:
Expand All @@ -93,8 +93,8 @@ install:
- name: dbpassword
secret: mywordpress-mysql
key: mysql-password
- description: "Install Wordpress"
helm:
- helm:
description: "Install Wordpress"
name:
source: bundle.parameters.wordpress-name
chart: stable/wordpress
Expand All @@ -108,8 +108,8 @@ install:
source: bundle.outputs.dbpassword

uninstall:
- description: "Uninstall Wordpress Helm Chart"
helm:
- helm:
description: "Uninstall Wordpress Helm Chart"
name:
source: bundle.parameters.wordpress-name
```
Expand Down Expand Up @@ -188,14 +188,14 @@ parameters:
default: mydb

install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: mysql
chart: stable/mysql
set:
mysqlDatabase:
source: bundle.parameters.database_name
outputs:
outputs:
- name: dbhost
secret: mysql
key: mysql-host
Expand Down Expand Up @@ -231,8 +231,8 @@ credentials:
path: /root/.kube/config

install:
- description: "Install Wordpress"
helm:
- helm:
description: "Install Wordpress"
name:
source: bundle.parameters.wordpress-name
chart: stable/wordpress
Expand Down
18 changes: 9 additions & 9 deletions examples/azure-ark/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ parameters:
default: porterdemocontainer

install:
- description: "Create Azure Storage Account and Container"
azure:
- azure:
description: "Create Azure Storage Account and Container"
type: storage
name: porter-azure-ark
resourceGroup:
Expand All @@ -50,12 +50,12 @@ install:
source: bundle.parameters.storage_account_name
storageContainerName:
source: bundle.parameters.storage_container_name
outputs:
- name: "STORAGE_ACCOUNT_KEY"
key: "STORAGE_ACCOUNT_KEY"
outputs:
- name: "STORAGE_ACCOUNT_KEY"
key: "STORAGE_ACCOUNT_KEY"

- description: "Helm Install Ark"
helm:
- helm:
description: "Helm Install Ark"
name: porter-azure-ark
chart: stable/ark
replace: true
Expand Down Expand Up @@ -83,6 +83,6 @@ install:
configuration.backupStorageProvider.bucket:
source: bundle.parameters.storage_container_name
uninstall:
- description: "Uninstall Ark"
azure:
- azure:
description: "Uninstall Ark"
name: porter-azure-ark
18 changes: 9 additions & 9 deletions examples/azure-mysql-wordpress/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ parameters:
default: "wordpress"

install:
- description: "Create Azure MySQL"
azure:
- azure:
description: "Create Azure MySQL"
type: mysql
name: mysql-azure-porter-demo-wordpress
resourceGroup: "porter-test"
Expand All @@ -48,12 +48,12 @@ install:
sslEnforcement: "Disabled"
databaseName:
source: bundle.parameters.database_name
outputs:
- name: "MYSQL_HOST"
key: "MYSQL_HOST"
outputs:
- name: "MYSQL_HOST"
key: "MYSQL_HOST"

- description: "Helm Install Wordpress"
helm:
- helm:
description: "Helm Install Wordpress"
name: porter-ci-wordpress
chart: stable/wordpress
replace: true
Expand All @@ -70,8 +70,8 @@ install:
externalDatabase.database:
source: bundle.parameters.database_name
uninstall:
- description: "Uninstall Wordpress"
azure:
- azure:
description: "Uninstall Wordpress"
name: porter-ci-wordpress


0 comments on commit 66dad26

Please sign in to comment.