CorefinityCorefinityDocs
Open the Control PanelControl Panel
Environments and copies · 2 of 3

Staging from a branch

Create a staging environment that runs one Git branch, with a copy of the site's database and uploads, and deploys again on every push.

On this page

Before you start

  • You can open the site in Managed Websites. Anyone who can open a site can create its environments.
  • The site is a WordPress site. Other platforms start an environment empty or from a copy.
  • A repository is connected on Production's Deployments: see Connect a repository.

Create the environment from a branch

  1. Open the create dialog

    Go to Managed Websites, choose the site, then Environments under Code & backups. Choose Create environment, then enter a Name and choose a Size.

  2. Choose A git branch

    Under Start from, choose A git branch. The dialog shows the site's repository.

  3. Choose the branch

    Choose the Branch from the list; Filter the branches narrows it. If the list cannot be read, enter the branch name.

  4. Choose the data

    Under Take database and uploads from, choose an environment, or Nothing (start empty). The data is copied once, when the environment is created; the code comes from the branch.

  5. Choose when it deploys

    Leave Deploy on push on to deploy the environment on every push to the branch. Turn it off to deploy by hand.

  6. Create it

    Choose Create environment. The environment is created, the data is copied, then the branch is deployed with the site's pipeline.

When it is ready, the environment's Deploy column in Environments shows Git, the branch and on push. If the first deployment fails, the environment still exists: open Deployments to see why.

The environment starts like any other staging environment, and its login is shown once when it is ready: see Create an environment.

Automate this

Staging from a branch

Adds a staging environment to the site, protected by HTTP authentication from the start, with the data source chooses.

POST/api/corestack/sites/{site}/environments
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/environments \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Review",
    "slug": "review",
    "source": {
      "environment_id": 1043,
      "scope": "files_db",
      "type": "clone"
    }
  }'
Was this helpful?
Open in ClaudeOpen in ChatGPT