Waddle projects can ship small shell scripts that Waddle runs automatically at specific points in the remote lifecycle. They live next to the platform’s other scripts:
website/script/unix/<platform>/<hook>.sh
Every hook is optional. If the file is absent, Waddle simply skips that step, so any platform, including a custom blueprint, can opt into a hook just by adding the file, and they always run from the project root.
Hooks are Handlebars templates
Every hook script is rendered as a Handlebars template at build time, just like the rest of a
project’s config, so it can embed project values directly instead of reading them at runtime. The
shipped platform scripts lean on this: the WordPress hooks resolve the CLI path with
{{project_path 'bin'}}/wp, and after_db_updated.sh pulls the target URL straight from
{{public.website.url}} or {{public.remotes.production.domain}} depending on which environment
synced. A custom hook can do the same, for example embedding a project’s rendered path when calling
into a container. See Template Functions and
Template Data for the full helper and data reference.
The hooks
| Hook | When Waddle runs it | Argument | Typical use |
|---|---|---|---|
after_project_update.sh |
At the end of every push to a remote (after services are up), and locally whenever the project’s website URL changes. | Local | Production | Stage | Dev |
Re-point domain-bearing config files (e.g. .env APP_URL) to the target environment. |
after_db_updated.sh |
After a database sync (download → locally; upload → on the remote; manual import → locally), and locally whenever the project’s website URL changes. | Local | Production | Stage | Dev |
Correct URLs that live inside the database. |
maintenance.sh |
On demand, from the project list’s remote actions → toggle maintenance mode. Runs on the remote over SSH. | is-active | enable | disable |
Open/close the site during a deploy. |
Contract shared by all hooks
- POSIX
sh(#!/bin/sh -eu), 100% POSIX-compliant. - Run with the project root as the working directory (so paths like
website/src/.envare relative). - Should be idempotent; Waddle may run them more than once across a project’s life.
Why the split between after_project_update and after_db_updated
The right hook depends on where the value being corrected is stored:
- A value in a config file (e.g. Laravel
APP_URL, MediaWiki$wgServer) travels with the project, so it is fixed byafter_project_update.shon each push. - A value in the database (e.g. WordPress
siteurl, Magentobase_url) only changes when the database changes, so it is fixed byafter_db_updated.shafter a sync.