Skip to content

Commit

Permalink
Merge pull request #996 from garden-io/provider-outputs
Browse files Browse the repository at this point in the history
feat(core): providers can now reference each others' outputs
  • Loading branch information
eysi09 authored Aug 7, 2019
2 parents bc6abcf + 06a7303 commit b5fcec7
Show file tree
Hide file tree
Showing 60 changed files with 943 additions and 587 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/containers/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useContext, useEffect } from "react"

import Sidebar from "../components/sidebar"
import { DataContext } from "../context/data"
import { DashboardPage } from "garden-service/build/src/config/dashboard"
import { DashboardPage } from "garden-service/build/src/config/status"

export interface Page extends DashboardPage {
path: string
Expand Down
122 changes: 121 additions & 1 deletion docs/reference/module-types/openfaas.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `openfaas` reference


Deploy [OpenFaaS](https://www.openfaas.com/) functions using Garden. Requires either the `openfaas` or
`local-openfaas` provider to be configured.

Below is the schema reference. For an introduction to configuring Garden modules, please look at our [Configuration
guide](../../using-garden/configuration-files.md).
Expand Down Expand Up @@ -198,6 +199,104 @@ POSIX-style path or filename to copy the directory or file(s).
| -------- | -------- | ------------------------- |
| `string` | No | `"<same as source path>"` |

### `dependencies`

The names of services/functions that this function depends on at runtime.

| Type | Required | Default |
| --------------- | -------- | ------- |
| `array[string]` | No | `[]` |

### `env`

Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with `GARDEN`) and values must be primitives.

| Type | Required | Default |
| -------- | -------- | ------- |
| `object` | No | `{}` |

### `handler`

Specify which directory under the module contains the handler file/function.

| Type | Required | Default |
| -------- | -------- | ------- |
| `string` | No | `"."` |

### `image`

The image name to use for the built OpenFaaS container (defaults to the module name)

| Type | Required |
| -------- | -------- |
| `string` | No |

### `lang`

The OpenFaaS language template to use to build this function.

| Type | Required |
| -------- | -------- |
| `string` | Yes |

### `tests`

A list of tests to run in the module.

| Type | Required | Default |
| --------------- | -------- | ------- |
| `array[object]` | No | `[]` |

### `tests[].name`

[tests](#tests) > name

The name of the test.

| Type | Required |
| -------- | -------- |
| `string` | Yes |

### `tests[].dependencies[]`

[tests](#tests) > dependencies

The names of any services that must be running, and the names of any tasks that must be executed, before the test is run.

| Type | Required | Default |
| --------------- | -------- | ------- |
| `array[string]` | No | `[]` |

### `tests[].timeout`

[tests](#tests) > timeout

Maximum duration (in seconds) of the test run.

| Type | Required | Default |
| -------- | -------- | ------- |
| `number` | No | `null` |

### `tests[].command[]`

[tests](#tests) > command

The command to run in the module build context in order to test it.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |

### `tests[].env`

[tests](#tests) > env

Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with `GARDEN`) and values must be primitives.

| Type | Required | Default |
| -------- | -------- | ------- |
| `object` | No | `{}` |


## Complete YAML schema
```yaml
Expand All @@ -216,6 +315,17 @@ build:
copy:
- source:
target: <same as source path>
dependencies: []
env: {}
handler: .
image:
lang:
tests:
- name:
dependencies: []
timeout: null
command:
env: {}
```

## Outputs
Expand Down Expand Up @@ -272,3 +382,13 @@ The outputs defined by the module.
| Type | Required |
| -------- | -------- |
| `object` | Yes |

### `modules.<module-name>.outputs.endpoint`

[outputs](#outputs) > endpoint

The full URL to query this service _from within_ the cluster.

| Type | Required |
| -------- | -------- |
| `string` | Yes |
29 changes: 29 additions & 0 deletions docs/reference/providers/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,32 @@ providers:
namespace:
setupIngressController: false
```

## Outputs

The following keys are available via the `${providers.<provider-name>}` template string key for `kubernetes`
providers.

### `providers.<provider-name>.app-namespace`

The primary namespace used for resource deployments.

| Type | Required |
| -------- | -------- |
| `string` | Yes |

### `providers.<provider-name>.default-hostname`

The default hostname configured on the provider.

| Type | Required |
| -------- | -------- |
| `string` | No |

### `providers.<provider-name>.metadata-namespace`

The namespace used for Garden metadata.

| Type | Required |
| -------- | -------- |
| `string` | Yes |
29 changes: 29 additions & 0 deletions docs/reference/providers/local-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,3 +832,32 @@ providers:
namespace:
setupIngressController: nginx
```

## Outputs

The following keys are available via the `${providers.<provider-name>}` template string key for `local-kubernetes`
providers.

### `providers.<provider-name>.app-namespace`

The primary namespace used for resource deployments.

| Type | Required |
| -------- | -------- |
| `string` | Yes |

### `providers.<provider-name>.default-hostname`

The default hostname configured on the provider.

| Type | Required |
| -------- | -------- |
| `string` | No |

### `providers.<provider-name>.metadata-namespace`

The namespace used for Garden metadata.

| Type | Required |
| -------- | -------- |
| `string` | Yes |
36 changes: 18 additions & 18 deletions docs/reference/providers/maven-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@ The reference is divided into two sections. The [first section](#configuration-k
| --------------- | -------- | ------- |
| `array[object]` | No | `[]` |

### `providers[].environments[]`
### `providers[].name`

[providers](#providers) > environments
[providers](#providers) > name

If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.
The name of the provider plugin to use.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| -------- | -------- |
| `string` | Yes |

Example:

```yaml
providers:
- environments:
- dev
- stage
- name: "local-kubernetes"
```
### `providers[].name`
### `providers[].environments[]`

[providers](#providers) > name
[providers](#providers) > environments

The name of the provider plugin to use.
If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.

| Type | Required | Default |
| -------- | -------- | ------------------- |
| `string` | Yes | `"maven-container"` |
| Type | Required |
| --------------- | -------- |
| `array[string]` | No |

Example:

```yaml
providers:
- name: "maven-container"
- environments:
- dev
- stage
```


Expand All @@ -55,6 +55,6 @@ The values in the schema below are the default values.

```yaml
providers:
- environments:
name: maven-container
- name:
environments:
```
Loading

0 comments on commit b5fcec7

Please sign in to comment.