Skip to content
Open
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
26 changes: 22 additions & 4 deletions standard/cli/command-reference/porter-apply.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,9 +75,10 @@ You can pass environment variables and secrets directly via command-line flags w

| Flag | Description |
|------|-------------|
| `--validate` | Check that the `porter.yaml` file is valid YAML syntax |
| `--dry-run` | Perform server-side validation to confirm the configuration is valid without applying changes |

To check a `porter.yaml` locally without building or deploying, use the [`porter apply validate`](#porter-apply-validate) subcommand.

### Advanced Options

| Flag | Short | Description |
Expand DownExpand Up@@ -117,9 +118,9 @@ porter apply -f porter.yaml --wait
porter apply -f porter.yaml --preview
```

```bash Validate YAML Syntax
# Check that porter.yaml is valid YAML
porter apply -f porter.yaml --validate
```bash Validate Locally
# Check porter.yaml against the schema without building or deploying
porter apply validate -f porter.yaml
```

```bash Dry Run
Expand All@@ -146,6 +147,23 @@ porter apply -f porter.yaml --variables LOG_LEVEL=debug,NODE_ENV=production --se
```
</CodeGroup>

## `porter apply validate`

Validate a `porter.yaml` file against the schema locally. This command does not build, push, or deploy, and does not contact the Porter API.

**Usage:**
```bash
porter apply validate -f porter.yaml
```

**Options:**

| Flag | Short | Description |
|------|-------|-------------|
| `--file` | `-f` | Path to the `porter.yaml` file (defaults to `porter.yaml` in the current directory) |

On success the command prints `✓ porter.yaml is valid`. On failure it prints the validation error and exits non-zero. For server-side validation of the full configuration against your project, use `porter apply --dry-run`.

## Workflow

When you run `porter apply`, the following steps occur:
Expand Down