Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions applications/configuration-as-code/addons-porter-yaml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ You can deploy multiple Porter apps alongside multiple Porter addons in a single

### Usage

To enable this feature, set the `PORTER_ADDON_YAML` environment variable while running the apply command.
Run `porter apply` against a `porter.yaml` that uses the top-level `apps:` and `addons:` arrays. The CLI automatically detects the multi-app format and applies each addon and app in sequence.

```bash
PORTER_ADDON_YAML=true porter apply -f porter.yaml
porter apply -f porter.yaml
```

### Waiting for addons to become available

Pass the `--wait` (`-w`) flag to block until each datastore addon reaches the `AVAILABLE` state before any apps are deployed. This is useful when your apps reference an addon's connection environment group (for example `db` or `cache` in the example below) — without `--wait`, an app can start rolling out before the datastore (and its generated env group) is ready, causing the app to crash on startup.

```bash
porter apply -f porter.yaml --wait
```

`--wait` polls each addon for up to 10 minutes. After all addons are available, Porter applies the apps and, as before, waits for each app's rollout to complete.

## Example Configuration

```yaml
Expand Down
4 changes: 2 additions & 2 deletions standard/cli/command-reference/porter-apply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ porter apply -f porter.yaml [flags]
| `--file` | `-f` | Path to the `porter.yaml` configuration file (optional if app already exists) |
| `--app` | | Override the app name specified in `porter.yaml` |
| `--target` | `-x` | Specify a deployment target (name or ID) |
| `--wait` | `-w` | Wait for the deployment to complete before exiting |
| `--wait` | `-w` | Wait for the deployment to complete before exiting. For multi-app `porter.yaml` files that include datastore addons, also waits up to 10 minutes for each addon to reach the `AVAILABLE` state before apps are deployed |
| `--preview` | `-p` | Deploy to a preview environment based on current git branch |

<Warning>
Expand Down Expand Up @@ -161,7 +161,7 @@ When you run `porter apply`, the following steps occur:
Porter deploys or updates all services defined in the configuration
</Step>
<Step title="Wait for Rollout (if --wait)">
If `--wait` is specified, Porter waits for all services to become healthy
If `--wait` is specified, Porter waits for all services to become healthy. When the `porter.yaml` defines datastore addons, Porter also waits for each addon to reach the `AVAILABLE` state before deploying the apps that depend on it.
</Step>
</Steps>

Expand Down