NW-16007: Add site-level cloud hook examples#62
Open
blkperl wants to merge 4 commits into
Open
Conversation
Added new cloud hook templates and examples for pre-site-code-deploy and post-site-code-deploy hooks: - samples/pre-site-code-deploy.tmpl: Basic template for pre-site-code-deploy - samples/post-site-code-deploy.tmpl: Basic template for post-site-code-deploy - samples/maintenance-mode-enable.sh: Enable Drupal maintenance mode before deployment - samples/maintenance-mode-disable-and-update.sh: Disable maintenance mode and optionally run database updates Updated README.md with documentation for the new hooks, including: - Added new samples to the sample scripts list - Added pre-site-code-deploy section to supported hooks - Added post-site-code-deploy section to supported hooks These hooks support site-level deployments with siteName and extraArgs parameters, enabling customers to manage Drupal maintenance mode and conditional database updates during deployment. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created hook directories for pre-site-code-deploy and post-site-code-deploy in all environments (common, dev, test, prod). These directories allow customers to place their site-level hook scripts in the appropriate environment folders, following the same pattern as existing hooks like post-code-deploy and post-db-copy. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed the example invocations to use "siteName" as a generic parameter name rather than a specific value like "mysite-prod" to better indicate this is a variable parameter. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
blkperl
commented
Jun 29, 2026
Co-authored-by: William Van Hevelingen <William.VanHevelingen@acquia.com>
poojapareekacq
approved these changes
Jun 30, 2026
OmkarVarhadi
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added new site-level cloud hook examples for
pre-site-code-deployandpost-site-code-deployhooks.These hooks operate at the site level and receive
siteNameandextraArgsparameters, enabling customers to:Changes
New Template Files
samples/pre-site-code-deploy.tmpl- Basic template for pre-site-code-deploy hooksamples/post-site-code-deploy.tmpl- Basic template for post-site-code-deploy hookNew Example Scripts
samples/maintenance-mode-enable.sh- Enables Drupal maintenance mode before site deployment (supports Drupal 7 and 8+)samples/maintenance-mode-disable-and-update.sh- Disables maintenance mode after deployment and optionally runs database updates if triggered via extraArgsDocumentation Updates
Use Cases
Pre-deployment:
# Enable maintenance mode before deployment cp hooks/samples/maintenance-mode-enable.sh hooks/common/pre-site-code-deployPost-deployment:
# Disable maintenance mode and run conditional updates cp hooks/samples/maintenance-mode-disable-and-update.sh hooks/common/post-site-code-deployWhen deploying via the Cloud UI/API with
extraArgs="update-db", the post-hook will automatically run database updates.Testing
All scripts follow existing patterns and conventions:
🤖 Generated with Claude Code