# vpctl release commands

> Pull, generate, deploy, and uninstall vpctl release commands

Use the `release` command group to manage the deployment lifecycle. Pull a release archive from the Unity registry, render Helm chart values from your manifest, deploy to your cluster or hand off to ArgoCD, and uninstall.

## Pull a release

Download a release from the registry. If you use a manifest file, the tool reads the version from the manifest automatically. By default, the release is extracted to `./extracted-release`.

```sh
vpctl release pull --clean-output
```

**Parameters:**

* `--extract-dir`: Directory to extract the archive to (default: `./extracted-release`).
* `--skip-extract`: Skip extracting the downloaded archive (default: extracts to `./extracted-release`).
* `--clean-output`: Clear the extraction directory before extracting.
* `--version`: Release version to pull (optional, defaults to value from manifest).
* `--registry`: Registry URL (default: `uccmpprivatecloud.azurecr.io`).
* `--output`: Output file path for the archive (default: `unity-private-cloud-<platform>-<version>.tar.gz`).

Example with manifest:

```sh
vpctl release pull --clean-output
```

Example without manifest, specify version:

```sh
vpctl release pull --version 1.2.3 --clean-output
```

Example with custom extraction directory:

```sh
vpctl release pull --extract-dir ./my-release --clean-output
```

Example skipping extraction:

```sh
vpctl release pull --skip-extract
```

## Generate and deploy charts

Choose your deployment method: **Helm** or **ArgoCD**.

### Generate Helm charts

```sh
vpctl release generate --clean-output
```

**Parameters:**

* `--clean-output`: Clean the output directory before generating
* `--format`: Output format (`argocd` generates app-of-apps chart structure; omit for standard Helm charts)
* `--extracted-release`: Path to extracted release (defaults to `./extracted-release`)
* `--output`: Output directory (defaults to `generated-charts`)
* `--name`: Filter to generate only charts matching a name pattern
* `--skip-version-check`: Skip vpctl version compatibility check against the release package

Example:

```sh
vpctl release generate --extracted-release ./extracted-release --output ./my-charts --clean-output
```

### Deploy with Helm

Preview deployment (recommended):

```sh
vpctl release deploy --dry-run
```

If you're deploying Asset Manager for the first time, deploy the release in waves. Start with the lowest wave, use the `--wave` flag, for example \`-3, then validate the deployment before deploying the next wave. This ensures the release deploys in the correct order and all dependencies are satisfied.

Execute deployment:

```sh
vpctl release deploy
```

**Common options:**

* `--dry-run`: Show commands without executing.
* `--format`: Deployment format (`helm` or `argocd`; defaults to `helm`).
* `--charts-dir`: Directory containing charts (defaults to `generated-charts`).
* `--wave`: Deploy only a specific wave (Helm format only; for example, `-3` is lowest, `0` is highest).
* `--name`: Deploy only a single chart by name.
* `--wait`: Wait for each Helm release to complete before moving on (default: `true`; disable with `--wait=false`).
* `--timeout`: Timeout per Helm release when `--wait=true` (default: `10m`; ignored when `--wait=false`).
* `--retries`: Number of additional attempts after a failed Helm command (default: `0`). Useful for the CRD-not-yet-visible race that sometimes resolves on a second attempt.
* `--retry-delay`: Delay between retry attempts (default: `5s`; only meaningful when `--retries > 0`).
* `--dependency-update`: Update chart dependencies before deployment (default: `true`). In parallel mode (`--concurrency` greater than `1`), the update runs as a separate step for each chart and skips the repository refresh.
* `--helm-flags`: Additional Helm flags to pass to the command.
* `--concurrency`: Number of charts to deploy in parallel within a wave (default: `1`, sequential; Helm format only). When you omit the flag, the manifest value `deployment.helm.concurrency` applies. Refer to the parallel deployment notes that follow.

Example deploying a specific wave:

```sh
vpctl release deploy --wave -3
```

#### Parallel deployment

Set `--concurrency N` (where `N` is greater than `1`) to deploy the charts within the same wave in parallel. You can also set `deployment.helm.concurrency` in the manifest to make it the default for your environment; the CLI flag takes precedence when both are set.

* Charts within the same wave deploy concurrently through a bounded worker pool of size `N`. Waves remain sequential: the next wave starts only after every chart in the current wave succeeds.
* The Helm chart repositories refresh once at the start of the deployment, and per-chart dependency updates skip the refresh, which avoids races on the shared Helm cache.
* Each chart's Helm output is buffered and printed as a single block when that chart finishes, for example `==> [chart-name] done in 12.3s`, so the line ordering differs from sequential mode and there's no live progress for an in-flight chart.
* A summary line at the end of every wave and at the end of the deployment reports the total, succeeded, and failed counts with the elapsed time. On failure, the error lists the failing chart names.
* Parallel deployment applies to the Helm format only: with `--format argocd`, any `--concurrency` value greater than `1` is rejected, because the ArgoCD path applies a single bootstrap `Application` and does no per-chart Helm work.

Example deploying with four workers:

```sh
vpctl release deploy --format helm --concurrency 4
```

### Manifest defaults for ArgoCD

You can define ArgoCD parameters in the manifest under `deployment.argocd` so you don't need to pass them every time. CLI flags always take precedence over manifest values when both are provided.

```yaml
# manifest.yaml
deployment:
  argocd:
    repoURL: "https://github.com/org/repo.git"
    pathPrefix: "onprem/cluster1"
    destinationServer: "https://kubernetes.default.svc"
    targetRevision: "main"
```

When the tool reads a value from the manifest instead of a CLI flag, it prints a log message, for example, `Using argocd-repo-url from manifest: ...`.

### Helm chart mode

The `deployment.helmChartMode` field controls how Helm charts are sourced:

```yaml
# manifest.yaml
deployment:
  helmChartMode: "local"   # default: use charts from the release package
```

| Value               | Behavior                                                                                                                                                                                                                                             |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"local"` (default) | All charts are installed from the release package. This is the safe default for existing installations and airgapped environments.                                                                                                                   |
| `"remote"`          | Charts marked as `type: "remote"` in `versions.yaml` are pulled from an OCI Helm registry at deploy time. Only `values.yaml` is generated locally; chart templates come from the registry. Requires syncing remote charts for airgapped deployments. |

If you omit this field, the tool uses `"local"`. Set `helmChartMode: "remote"` to opt in to OCI remote charts.

### Generate ArgoCD application

If you set `deployment.argocd` in the manifest, you only need to pass flags you want to override:

```sh
vpctl release generate --format argocd --clean-output
```

Or override specific values for each run:

```sh
vpctl release generate --format argocd --argocd-path-prefix <path-prefix> --argocd-target-revision <branch-or-tag> --clean-output
```

You can still pass all flags explicitly, they take precedence over the manifest:

```sh
vpctl release generate --format argocd --argocd-repo-url <your-git-repo-url> --argocd-destination "https://kubernetes.default.svc" --argocd-target-revision "main" --argocd-path-prefix <path-prefix> --clean-output
```

**Parameters:**

* `--format argocd`: Generate ArgoCD format
* `--argocd-repo-url`: Git repository URL where charts are stored (can be set in manifest `deployment.argocd.repoURL`)
* `--argocd-destination`: Kubernetes server URL (can be set in manifest `deployment.argocd.destinationServer`)
* `--argocd-target-revision`: Git branch/tag to use (can be set in manifest `deployment.argocd.targetRevision`)
* `--argocd-path-prefix`: Path prefix in the Git repository (can be set in manifest `deployment.argocd.pathPrefix`)
* `--clean-output`: Clean output directory before generating

This command creates an app-of-apps chart structure in the output directory.

### Deploy ArgoCD application

Preview deployment (recommended):

```sh
vpctl release deploy --format argocd --dry-run
```

Execute deployment:

```sh
vpctl release deploy --format argocd
```

**Common options:**

* `--format argocd`: Use ArgoCD deployment
* `--dry-run`: Preview kubectl command without executing
* `--charts-dir`: Directory containing charts (defaults to `generated-charts`)

## Uninstall a release

To remove a deployed release, use the uninstall command. The tool uninstalls charts in reverse wave order with the highest wave first to ensure dependencies are removed correctly.

Preview uninstall commands (recommended):

```sh
vpctl release uninstall --dry-run
```

Execute uninstall:

```sh
vpctl release uninstall
```

**Common options:**

* `--dry-run`: Show commands without executing
* `--charts-dir`: Directory containing charts (defaults to `generated-charts`)
* `--wave`: Uninstall only charts in the specified wave (for example `-3` is lowest, `0` is highest)
* `--name`: Uninstall only a single chart (chart name)

Example uninstalling a specific wave:

```sh
vpctl release uninstall --wave 0 --dry-run
```

Example uninstalling a specific chart:

```sh
vpctl release uninstall --name my-chart --dry-run
```

The uninstall command uses `helm uninstall` for Helm-deployed charts and `helm template | kubectl delete` for charts deployed with templateApply, such as. kube-prometheus-stack.
