Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Sample scripts currently include:
* post-code-update.tmpl: Template for post-code-update hook scripts.
* post-db-copy.tmpl: Template for post-db-copy hook scripts.
* post-files-copy.tmpl: Template for post-files-copy hook scripts.
* pre-site-wipe.tmpl: Template for pre-site-wipe hook scripts.
* post-site-wipe.tmpl: Template for post-site-wipe hook scripts.
* post-site-instance-duplicate.tmpl: Template for post-site-instance-duplicate hook scripts.
* post-site-associate.tmpl: Template for post-site-associate hook scripts.
* update-db.sh: Run drush updatedb to perform database updates.
* db-scrub.sh: Scrub important information from a Drupal database.
* drupal-tests.sh: Run Drupal simpletests.
Expand Down Expand Up @@ -156,3 +160,41 @@ Usage: post-files-copy site target-env source-env
Example: When you use the Workflow page to drag files from Prod to Dev, the files-copy hook will be run like:

post-files-copy mysite prod dev

### pre-site-wipe

The pre-site-wipe hook is run before a site's database and files are wiped from an environment. This allows you to perform backups or other preparatory actions before the site data is removed.

Usage: pre-site-wipe app-name stage

* app-name: The application name for the site.
* stage: The environment stage (dev, test, or prod) from which the site will be wiped.

### post-site-wipe

The post-site-wipe hook is run after a site's database and files have been wiped from an environment. This allows you to perform cleanup, notifications, or initialization of a fresh environment.

Usage: post-site-wipe app-name stage

* app-name: The application name for the site.
* stage: The environment stage (dev, test, or prod) from which the site was wiped.

### post-site-instance-duplicate

The post-site-instance-duplicate hook is run after a site instance has been duplicated to create a new environment. This allows you to perform post-duplication configuration, data scrubbing, or environment-specific setup.

Usage: post-site-instance-duplicate app-name stage source-site-name

* app-name: The application name for the target site.
* stage: The environment stage (dev, test, or prod) of the target environment.
* source-site-name: The name of the source site that was duplicated.

### post-site-associate

The post-site-associate hook is run after a site has been associated with an environment. This allows you to perform initialization tasks, configure environment-specific settings, or set up integrations.

Usage: post-site-associate app-name stage site-name

* app-name: The application name for the site.
* stage: The environment stage (dev, test, or prod) with which the site was associated.
* site-name: The name of the site that was associated.
15 changes: 15 additions & 0 deletions samples/post-site-associate.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# Cloud Hook: post-site-associate
#
# The post-site-associate hook is run after a site has been associated with
# an environment. This allows you to perform initialization tasks, configure
# environment-specific settings, or set up integrations.
#
# Usage: post-site-associate app-name stage site-name

app_name="$1"
stage="$2"
site_name="$3"

echo "$app_name.$stage: Site $site_name associated with environment."
15 changes: 15 additions & 0 deletions samples/post-site-instance-duplicate.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# Cloud Hook: post-site-instance-duplicate
#
# The post-site-instance-duplicate hook is run after a site instance has been
# duplicated to create a new environment. This allows you to perform
# post-duplication configuration, data scrubbing, or environment-specific setup.
#
# Usage: post-site-instance-duplicate app-name stage source-site-name

app_name="$1"
stage="$2"
source_site_name="$3"

echo "$app_name.$stage: Site instance duplicated from $source_site_name."
14 changes: 14 additions & 0 deletions samples/post-site-wipe.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Cloud Hook: post-site-wipe
#
# The post-site-wipe hook is run after a site's database and files have been
# wiped from an environment. This allows you to perform cleanup, notifications,
# or initialization of a fresh environment.
#
# Usage: post-site-wipe app-name stage

app_name="$1"
stage="$2"

echo "$app_name.$stage: Site wipe completed."
14 changes: 14 additions & 0 deletions samples/pre-site-wipe.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Cloud Hook: pre-site-wipe
#
# The pre-site-wipe hook is run before a site's database and files are wiped
# from an environment. This allows you to perform backups or other preparatory
# actions before the site data is removed.
#
# Usage: pre-site-wipe app-name stage

app_name="$1"
stage="$2"

echo "$app_name.$stage: Preparing for site wipe."