Skip to content

Commit

Permalink
docs(wiring.md): update step structure
Browse files Browse the repository at this point in the history
Signed-off-by: Vaughn Dice <[email protected]>
  • Loading branch information
vdice committed Jan 23, 2020
1 parent 7613f75 commit d8a5753
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions docs/content/wiring.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Once a parameter has been declared in the `porter.yaml`, Porter provides a simpl

```yaml
install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: porter-ci-mysql
chart: stable/mysql
version: 0.10.2
Expand Down Expand Up @@ -108,22 +108,22 @@ In addition to parameters and credentials, Porter introduces a type called an ou
```yaml
install:
- arm:
description: "Create Azure MySQL"
type: arm
template: "arm/mysql.json"
name: demo-mysql-azure-porter-demo-wordpress
resourceGroup: "porter-test"
parameters:
administratorLogin: "{{ bundle.parameters.mysql_user}}"
administratorLoginPassword: "{{ bundle.parameters.mysql_password }}"
location: "eastus"
serverName: "mysql-jeremy-porter-test-jan-2018"
version: "5.7"
sslEnforcement: "Disabled"
databaseName: "{{ bundle.parameters.database_name }}"
outputs:
- name: "MYSQL_URL"
key: "MYSQL_HOST"
description: "Create Azure MySQL"
type: arm
template: "arm/mysql.json"
name: demo-mysql-azure-porter-demo-wordpress
resourceGroup: "porter-test"
parameters:
administratorLogin: "{{ bundle.parameters.mysql_user}}"
administratorLoginPassword: "{{ bundle.parameters.mysql_password }}"
location: "eastus"
serverName: "mysql-jeremy-porter-test-jan-2018"
version: "5.7"
sslEnforcement: "Disabled"
databaseName: "{{ bundle.parameters.database_name }}"
outputs:
- name: "MYSQL_URL"
key: "MYSQL_HOST"
```

In this example, a new output will be created named `MYSQL_URL`. The Azure mixin allows you to specify the key to fetch the output from, in this case it is `MYSQL_HOST`. Each mixin can provide different ways of addressing outputs, so refer to the schema for each mixin. The Porter runtime will keep a map in memory with each of the outputs declared.
Expand All @@ -137,8 +137,8 @@ Once an output has been declared, it can be referenced in the same way as parame
For example, given the install step above, we can use the `MYSQL_URL` with the helm mixin in the following way:

```yaml
- description: "Helm Install Wordpress"
helm:
- helm:
description: "Helm Install Wordpress"
name: porter-ci-wordpress
chart: stable/wordpress
set:
Expand Down Expand Up @@ -169,8 +169,8 @@ images:
These images will be used to build the `bundle.json` images section, but can also be referenced using the same syntax you would use for referencing `parameters`, `credentials`, and `outputs`.

```yaml
- description: "Helm Install Wordpress"
helm:
- helm:
description: "Helm Install Wordpress"
name: porter-ci-wordpress
chart: stable/wordpress
set:
Expand Down Expand Up @@ -206,22 +206,22 @@ parameters:
env: MYSQL_USER
install:
- description: "Install MySQL"
helm:
- helm:
description: "Install MySQL"
name: porter-ci-mysql
chart: stable/mysql
version: 0.10.2
version: 1.6.2
replace: true
set:
mysqlDatabase: "{{ bundle.parameters.database-name }}"
mysqlUser: "{{ 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
```

In this bundle, we see the normal declaration of credentials, parameters and outputs, along with the use of `"{{ bundle.x.y.z }}"` to use these. With this bundle definition, we can build a second bundle to install wordpress and declare a dependency on this bundle. The `porter.yaml` for this might look something like:
Expand Down Expand Up @@ -252,8 +252,8 @@ parameters:
env: WORDPRESS_NAME
install:
- description: "Install Wordpress"
helm:
- helm:
description: "Install Wordpress"
name: "{{ bundle.parameters.wordpress-name }}"
chart: stable/wordpress
replace: true
Expand All @@ -267,8 +267,8 @@ The wordpress bundle declares a dependency on the `mysql` bundle, which we saw a

```yaml
install:
- description: "Install Wordpress"
helm:
- helm:
description: "Install Wordpress"
name: "{{ bundle.parameters.wordpress-name }}"
chart: stable/wordpress
replace: true
Expand All @@ -288,8 +288,8 @@ It is possible to reference multiple parameters, credentials and/or outputs in a

```yaml
install:
- description: "Install Java App"
helm:
- helm:
description: "Install Java App"
name: "{{ bundle.parameters.cool-app}}"
chart: stable/wordpress
replace: true
Expand Down

0 comments on commit d8a5753

Please sign in to comment.