---
title: "Rehearse a pipeline"
url: https://docs.corefinity.com/guides/sites/code-and-deployments/rehearse-a-pipeline
type: guide
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/api/reference/deployments/clear-site-deployment-build-caches.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/accept-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/update-site-deployment-options.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-pipeline.md
  - https://docs.corefinity.com/api/reference/deployments/check-site-deployment-pipeline-lines.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_stage_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_settings_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_check.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_copy.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_versions_list.md
---
# Rehearse a pipeline

Run a site's saved pipeline on its staging environment before a deployment uses it on Production.

## Before you start

- You are an owner, or your role has **Edit Environment Deployment Pipeline**.
- The site has a staging environment: see [Create an environment](/guides/sites/environments-and-copies/create-an-environment). Rehearsals never run on Production.
- Your changes to the pipeline are saved: see [Pipeline](/guides/sites/code-and-deployments/pipeline-stages).

## Start a rehearsal

A rehearsal builds your code and runs the database commands on the staging environment.

1. **Open the dialog**

   Go to **Managed Websites**, choose the site, then **Deployments** under **Code & backups**. On the **Pipeline** card of the Production environment, choose **Rehearse on Staging…**.

2. **Choose what to build**

   Choose the environment under **Rehearse on**. Leave **Branch, tag or commit** blank to build the branch this pipeline deploys, or enter another, then choose **Start**.

   _Screenshot: The Rehearse on Staging dialog: Staging chosen under Rehearse on, an empty Branch, tag or commit box, the note that the saved pipeline is used and nothing on Production changes, and the buttons Cancel and Start._

3. **Read the result**

   **Rehearsal on Staging** appears under the **Pipeline** card and follows each step: **Build**, **Upload**, **Shared files**, **Platform step** and **Database commands**. A failed step shows the command that failed, with its exit code.

   _Screenshot: The Pipeline card with Rehearsal on Staging ringed beneath it: the label Rehearsal passed, a tick beside each of Build, Upload, Shared files, Platform step and Database commands, and Dismiss._

The rehearsal ends as **Rehearsal passed** or **Rehearsal failed**. Choose **Open the log** for the full output, and **Dismiss** when you have read the result.

## What a rehearsal leaves out

- The staging environment's release is not switched, and nothing on Production changes.
- After-deploy commands do not run.
- Commands that reach the network are skipped, and listed under the steps.

## Automate this

**API:** [Start a pipeline rehearsal](https://docs.corefinity.com/api/reference/deployments/start-site-deployment-rehearsal.md), scope `exec`

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/rehearsals \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "binding_id": 2211
  }'
```

**MCP:** [`corestack_deployments_rehearse`](https://docs.corefinity.com/mcp/tools/corestack_deployments_rehearse.md), scope `exec`

```json
{
  "name": "corestack_deployments_rehearse",
  "arguments": {
    "site_id": 4212,
    "binding_id": 1841,
    "proposal": {
      "database": {
        "lines": ["wp option get siteurl"]
      }
    }
  }
}
```

**Control Panel:** Managed Websites › your site › Code & backups › Deployments ([https://manage.corefinity.com/go/deployment-pipeline](https://manage.corefinity.com/go/deployment-pipeline))

## Related

- [Pipeline](/guides/sites/code-and-deployments/pipeline-stages): Change what a deployment runs.
- [Create an environment](/guides/sites/environments-and-copies/create-an-environment): Add, rename or delete a staging environment.
- [Deployment log](/guides/sites/code-and-deployments/deployment-log): Find the command that failed.
