CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployment pipeline · 7 of 15

Copy a pipeline from another environment

Copies the chosen parts of the pipeline of another environment of the same site onto this one: its stages, settings, variables, registry secrets and deployment options. Send dry_run true to see what would change and write nothing; copying onto a production environment needs confirm_production true. Your role needs the Edit Environment Deployment Pipeline permission.

POST/api/corestack/sites/{site}/deployments/pipeline/{binding}/copy
  • Needs exec as well: The copied stages bring a command this pipeline does not run now (never for a dry run).

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

bindingintegerRequired

The id of one of the environment's pipelines, as the pipeline read answers it in binding_id and bindings[].id. Digits only. At least 1.

Body

confirm_productionboolean

True to copy onto a production environment.

dry_runboolean

Write nothing and answer what would change.

from_binding_idinteger

One of that environment's pipelines. Its repository's pipeline when left out. At least 1.

from_site_idintegerRequired

The site row of another environment of the same site. At least 1.

partsarray of stringsRequired

Up to 5 items.

stagessettingsvariablessecretsoptions
revisionstring

The revision of this pipeline that you read. Needed to copy stages or settings, which are refused stale without it; a dry run checks against the pipeline as it is now when it is left out.

Returns

200 What was, or would be, copied, part by part.

Fields of the 200 answer
dry_runbooleanRequired
from_site_idinteger
partsarray of objectsRequired

Each part asked for, with what changed.

Fields of each item
addedarray of strings

What the copy adds to this pipeline.

overwrittenarray of strings

What it replaces.

partstringRequired
removedarray of strings
unchangedarray of strings

What is already the same.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403forbiddenThe person is not allowed to do this.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409pipeline_classicCorefinity still runs this pipeline in its classic form, so it cannot be edited yet.
409pipeline_lockedCorefinity has locked this pipeline: Held while a migration is checked.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422confirmThe action needs an explicit confirmation field. Ask the person, then send it.
422line_credentialsThis line holds a credential. Move this value into a variable, then save again.
422maintenance_policy_unavailableChoose Always or Off: this platform has no pending-upgrade check.
422invalidFix the field named in field; errors says why.
422timeout_out_of_rangeChoose a timeout between 60 and 3600 seconds.
422version_unavailableThis version is not available here.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/pipeline/2210/copy \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "from_site_id": 1042,
    "parts": [
      "stages",
      "settings"
    ],
    "revision": "3b4b4f4d2bd57cc6"
  }'
{
  "dry_run": false,
  "from_site_id": 1042,
  "parts": [
    {
      "added": [],
      "overwritten": [
        "post_deploy"
      ],
      "part": "stages",
      "removed": [],
      "unchanged": [
        "build",
        "database"
      ]
    },
    {
      "added": [],
      "overwritten": [],
      "part": "settings",
      "removed": [],
      "unchanged": [
        "maintenance_policy",
        "tunnels",
        "pause_crons",
        "run_migrations",
        "timeouts",
        "keep_node_modules"
      ]
    }
  ]
}
Try it

Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT