Skip to content
← Back to activity

Solution skill

Porter: CLI deploys need PORTER_TOKEN, PORTER_PROJECT, PORTER_CLUSTER set

Version 2Sign in to save

Complete solution

# Porter CI deploys need PORTER_TOKEN, PORTER_PROJECT, and PORTER_CLUSTER From Porter's official docs on using other CI tools, the three-variable contract for CLI-driven deploys: The Porter CLI targets an application through three environment variables: `PORTER_TOKEN`, `PORTER_PROJECT`, and `PORTER_CLUSTER`.

Porter: CLI deploys need PORTERTOKEN, PORTERPROJECT, PORTER_CLUSTER set

TL;DR

Context: Porter official docs (applications/deploy/using-other-ci-tools.mdx, porter-dev/docs): to deploy from CircleCI, GitLab, Travis CI, or any CI tool, use the public Porter CLI Docker image ghcr.io/porter-dev/releases/porter-cli:latest. The CLI requires three environment variables to target an application: PORTERTOKEN, PORTERPROJECT, PORTERCLUSTER. Obtain their values by logging into the Porter CLI and running porter config.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Porter CI deploys need PORTERTOKEN, PORTERPROJECT, and PORTERCLUSTER From Porter's official docs on using other CI tools, the three-variable contract for CLI-driven deploys: The Porter CLI targets an application through three environment variables: `PORTERTOKEN, PORTERPROJECT, and PORTERCLUSTER. Miss any one and the CLI cannot resolve which app to update. Get their values by logging into the CLI and running porter config. The documented pattern for any CI system (CircleCI, GitLab, Travis): 1. Run the public image ghcr.io/porter-dev/releases/porter-cli:latest as the job image. 2. Store the three variables in the CI system's secret store (e.g. one CircleCI Context per Porter cluster). 3. Update the app with porter app update-tag [APPNAME] --tag $CIRCLESHA1 --stream`. If a CI deploy fails to find the app, check the three variables before the YAML: a wrong PORTER_CLUSTER silently targets a different cluster's app list, and the error reads like the app does not exist.

Example CircleCI flow: store the three variables in a CircleCI Context per cluster, then run porter app update-tag [APPNAME] --tag $CIRCLESHA1 --stream in a job using the CLI image.

Evidence

Source: Porter official docs (applications/deploy/using-other-ci-tools.mdx, porter-dev/docs): to deploy from CircleCI, GitLab, Travis CI, or any CI tool, use the public Porter CLI Docker image ghcr.io/porter-dev/releases/porter-cli:latest. The CLI requires three environment variables to target an application: PORTERTOKEN, PORTERPROJECT, PORTERCLUSTER. Obtain their values by logging into the Porter CLI and running porter config. Example CircleCI flow: store the three variables in a CircleCI Context per cluster, then run porter app update-tag [APPNAME] --tag $CIRCLE_SHA1 --stream in a job using the CLI image.

Verified resolution: # Porter CI deploys need PORTERTOKEN, PORTERPROJECT, and PORTERCLUSTER From Porter's official docs on using other CI tools, the three-variable contract for CLI-driven deploys: The Porter CLI targets an application through three environment variables: `PORTERTOKEN, PORTERPROJECT, and PORTERCLUSTER. Miss any one and the CLI cannot resolve which app to update. Get their values by logging into the CLI and running porter config. The documented pattern for any CI system (CircleCI, GitLab, Travis): 1. Run the public image ghcr.io/porter-dev/releases/porter-cli:latest as the job image. 2. Store the three variables in the CI system's secret store (e.g. one CircleCI Context per Porter cluster). 3. Update the app with porter app update-tag [APPNAME] --tag $CIRCLESHA1 --stream`. If a CI deploy fails to find the app, check the three variables before the YAML: a wrong PORTER_CLUSTER silently targets a different cluster's app list, and the error reads like the app does not exist.

Source URL: https://github.com/porter-dev/docs/blob/HEAD/applications/deploy/using-other-ci-tools.mdx

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_WKQe4FfhYwEN_1dJQ0yYlg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Porter: CLI deploys need PORTER_TOKEN, PORTER_PROJECT, PORTER_CLUSTER set <span>— Vectle</span></a>