Create or refresh a staging environment
Create a staging environment for a site, or refresh an existing one from another environment, then check it answers.
On this page
Start it
Paste this into an assistant that is connected to Corefinity.
Use the Corefinity MCP prompt "create-staging" with site: <the site: its domain, or the id of any of its environments>, name: <the staging environment's name. defaults to staging>, copy_from: <the environment to copy from. defaults to production>, branch: <a git branch to deploy to it afterwards, if any>. Follow it step by step and tell me before anything that changes my account.Arguments
The site: its domain, or the id of any of its environments.
The staging environment's name. Defaults to Staging.
The environment to copy from. Defaults to production.
A Git branch to deploy to it afterwards, if any.
What your assistant is told
Purpose: give <the site's domain> a staging environment, or refresh an existing one from another environment, and check it answers.
- The environment to create or refresh: <name> (when not given:
Staging). - Copy it from: <copy from> (when not given: production).
- A branch to deploy to it afterwards: <branch>.
Before you start
- The site row you start from is <the id of the site row you work on>. Use it as
site_id. - Ask before every change, and type a
confirm_*value only after the person has said yes to that exact action. - Secrets, such as the environment's HTTP login, open in the person's browser. Never ask for
reveal_to_agent: trueunless the person asks for the value to be given to you. - If a call is refused because this token lacks a scope or the site is outside its limits, the person is asked to allow it in the Control Panel; carry on once they have.
Steps
- Does it exist, and is there room? Read
corestack_environment_list. Check room withcorestack_uat_sizes_listfor a CoreStack site, orcorecluster_capacity_checkfor a CoreCluster site. If the person wants a price first, askcorestack_billing_quote_preview. - Create or refresh.
- New:
corestack_environment_createwith asourcethat clones the environment named above (production when none is named). - Existing:
corestack_site_clone_preview, thencorestack_site_cloneonto it. Never clone onto production in this playbook. A copy that only has to wait (the preview'squeuesis true) is queued and starts on its own: tell the person, and follow its task. Whencorestack_environment_listalready shows a copy waiting onto it inqueued_copies, another is refused until that one starts; cancel the waiting one withcorestack_queued_copy_cancelonly once the person agrees.
- New:
- A branch, if one was named: read
corestack_deployments_get, then runcorestack_deployment_triggerwhen the environment deploys from Git. - Verify with
corestack_site_http_check. The environment's HTTP login opens in the person's browser throughcorestack_http_auth_reveal_password.
A create that waits because the region's platform is not taking new changes for a while ("Waiting for the platform") carries on by itself: follow it with corestack_site_progress_get or corestack_site_operation_get instead of creating it again.
Stop and ask
- Before creating or replacing anything, and before any price is incurred.
- If the copy would land on production: stop; this playbook never writes production.
When you are done
Report the environment's address and how the person gets its login.