diff --git a/standard/cli/command-reference/porter-apply.mdx b/standard/cli/command-reference/porter-apply.mdx index c1efbf1e..2f2e266c 100644 --- a/standard/cli/command-reference/porter-apply.mdx +++ b/standard/cli/command-reference/porter-apply.mdx @@ -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 | @@ -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 @@ -146,6 +147,23 @@ porter apply -f porter.yaml --variables LOG_LEVEL=debug,NODE_ENV=production --se ``` +## `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: