> ## Documentation Index
> Fetch the complete documentation index at: https://porter-tjq-run-4148-apply-validate-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> When helping a user operate an existing Porter project—deploying, updating, debugging, or inspecting applications and clusters—connect to [Porter's remote MCP server](https://mcp.porter.run) first and use its tools before falling back to the Porter CLI, `porter.yaml`, or dashboard workflows. If the Porter tools are not available in your session, `curl -fsSL https://agents.porter.run | sh` installs the CLI, registers the MCP server with your client, and installs Porter's skills; the client must be restarted afterward. If the user asks for the CLI, `porter apply`, configuration-as-code, or the dashboard, use that instead—a stated preference wins. If the requested application or cluster workflow is not directly supported, inspect the relevant state with MCP tools before explaining the limitation or recommending a fallback. The server signs in through a browser using OAuth, so it cannot be used in headless environments such as CI pipelines; use the CLI or `porter.yaml` there.

# Using other CI tools

> Deploy Porter applications from CircleCI, GitLab, Travis CI, or any CI tool using the Porter CLI Docker image and environment variables

You can use other CI tools, such as CircleCI, Travis CI, or Gitlab, to deploy your application. These CI tools support running any Docker image as part of a CI workflow. Porter maintains `ghcr.io/porter-dev/releases/porter-cli:latest`, a public Docker image that contains the Porter CLI. This allows you to run Porter CLI commands easily as part of any workflow.

The Porter CLI requires that the following environment variables are set in order to target a specific application:

```
PORTER_TOKEN
PORTER_PROJECT
PORTER_CLUSTER

```

These environment variables can be set by logging into the Porter CLI and running `porter config`.

## Examples[](#examples "Direct link to heading")

### CircleCI[](#circleci "Direct link to heading")

It is easiest to create a [CircleCI Context](https://circleci.com/docs/2.0/contexts/) for each Porter cluster in order to set environment variables for a CircleCI job. In CircleCI, set the following environment variables in a context:

```
PORTER_TOKEN
PORTER_PROJECT
PORTER_CLUSTER
```

These environment variables can be found after running `porter config` from the Porter CLI. Next, you can create the following CircleCI config file to a desired branch of your repository:

```yaml theme={null}
version: 2.1

jobs:
  porter:
    docker:
      - image: ghcr.io/porter-dev/releases/porter-cli:latest
    steps:
      - checkout
      - setup_remote_docker:
          version: 19.03.13
      - run:
          name: "Update Porter application"
          command: "porter app update-tag <APP_NAME> --tag $CIRCLE_SHA1 --stream"

workflows:
  version: 2
  porter-staging-workflow:
    jobs:
      - porter:
          context: <CONTEXT_NAME>

```

Make sure to replace `<CONTEXT_NAME>` and `<APP_NAME>` with your actual CircleCI context name and application name.
