A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
Multi-Experience Operations enables concurrent, site-level code deployments for environments with multiple sites. This method minimizes downtime because each site enters maintenance mode only during its specific update instead of the entire environment-wide deployment.
To initialize a deployment, you must first configure your environment settings and then do the code switch.
This configuration is optional because the platform updates three sites concurrently in a standard sequence by default. You must complete this configuration only if a specific workflow requires a custom deployment order or a different concurrency limit.
To setup the update order:
Environment level post-code-deploy hook
Site level post-site-code-deploy hook for each site
During an active deployment, the interface displays the status of individual sites. To manage the queue, click Stop to cancel the deployment process. Submit a new code deployment promptly to ensure that sites do not split between two code versions.
MEO environments support two types of Cloud Hooks:
Environment level hook: post-code-deploy. The hook run one time for each deployment.
Site level hook: pre-site-code-deploy and post-site-code-deploy. These hooks run one time for each site in a batch.
The following requirements apply to the site-level hooks that you use to manage the maintenance mode for each site.
For additional information on Cloud Hooks, refer to Automating with Cloud Hooks.
Site-Level Triggers: Configure hooks to respond to the pre-site-code-deploy and post-site-code-deploy events. These are the only available site-level hook events.
Minimum Recommended Snippet Logic:
pre-site-code-deploy: Put the specific site into maintenance mode.
post-site-code-deploy: Run required database updates and take the site out of maintenance mode.
Process Arguments: This step is optional. If a workflow requires custom parameters or logic overrides, update hook scripts to process arguments that pass from Switch Code UI. Hooks that do not use arguments continue to function normally.
Test: Run the hook scripts manually through an SSH session to verify their behavior and debug logic before you rely on them in the deployment queue.
A Switch Code operation in an MEO environment proceeds in the following sequence:
Cron jobs run with the new code version during the early stages of the rollout.
A second rollout of pods launches with the new code.
The platform executes any scripts placed in the hooks/<env>/ directory of the codebase.
pre-site-code-deploy hooks run for each site in the batch.post-site-code-deploy hooks run for each site in the batch.post-code-deploy) run. The platform executes any scripts placed in the hooks/<env>/post-code-deploy/ directory of the codebase.
SSH access uses the previous code version until the final deployment steps complete.
After you push a commit to a branch that is already deployed to an MEO environment, the deployment behaves differently from a SwitchCode operation:
post-code-update environment-level Cloud Hook fires.pre-site-code-deploy and post-site-code-deploy site-level hooks do not fire.This mirrors the behavior of a standard Cloud Platform code update triggered by a git push.
The following table summarizes the hook and batching behavior for each deployment trigger type:
| Trigger | Hooks fired | Site-level hooks | Batching |
|---|---|---|---|
| SwitchCode (UI / new tag or branch) | pre-site-code-deploy, post-site-code-deploy, post-code-deploy | Yes | Yes (default: 3 concurrent) |
| Git push to deployed branch (branch tracking) | post-code-update | No | No |
When you stop an active deployment, the following events occur:
A stop task request displays in the User Interface (UI).
The task log of the original code deployment task includes the task ID of the stop request.
The platform terminates active Cloud Hooks and Cloud Actions.
A stopped deployment leaves the environment in a split state because the ingress switches to the new code on a per-site basis as sites progress through the queue. You must submit a new code deployment promptly to ensure that sites do not remain split between two code versions.
If a code deployment task fails, complete these steps:
Review the task logs to determine whether a platform issue or a Cloud Hook script error caused the failure.
For platform failures, retry the deployment. If the failure persists, open a Support ticket and include the task ID.
For Cloud Hook failures, debug the script code. Test the scripts manually through an SSH session.
To bring all sites back to a consistent state after a split-state failure or a stopped deployment:
Resolve all hook errors.
Test the scripts manually through an SSH session.
Submit a new full code deployment with the same code version or a new code version.
If Cloud Hooks call external services such as APIs, third-party integrations, and Content Delivery Network (CDN) purge endpoints, ensure that the scripts include the following:
Retry logic: Handle transient failures such as network timeouts and 5xx responses gracefully to prevent unnecessary deployment errors.
Timeouts: Set explicit connection and execution timeouts to prevent hooks from entering an unresponsive state and to ensure that they do not block the deployment queue. Each site-level or environment-level hook has a maximum execution time of 3 hours.
A hook that enters an unresponsive state on an external service blocks the batch slot of that site. This action reduces effective concurrency and extends the total deployment time.
The code version on the Sites page indicates whether Cloud Hooks are complete for that site and whether the site uses the new code. A site can serve the new code before the codeVersion field updates in the UI. The update sequence for each site runs as follows:
Pre-site hooks run.
The system directs site traffic to the new code.
Post-site hooks run.
The code version updates after all hooks complete. If a post-site hook fails, the site runs the new code and the UI displays the previous code version.
If you disassociate a site from an environment and re-associate it within the grace period before deletion, the site instance restores to a Ready state. However, the code version does not update to the latest deployed commit.
After re-association, you must submit a full code deployment for the environment. This deployment skips the sites that already use the current version. This process is similar to a new site association and sets the code version to the current version.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.