Skip to content

Fleet Deployment

webdesign29 edited this page Jun 13, 2026 · 1 revision

Fleet Deployment

bin/deploy-fleet.sh installs / updates / removes bext-wp across every WordPress site on a host. It's the recommended way to run the plugin as a must-use plugin on a bext server.

Why copy, not symlink

Each site typically runs under a strict open_basedir (/home/<user>/<site>/public/:/tmp/). A shared symlink pointing outside that root is blocked. So the script copies the package into each site's own tree and chowns it to the site user.

Usage

sudo bin/deploy-fleet.sh --list                 # list discovered WP sites
sudo bin/deploy-fleet.sh --dry-run              # show what would happen, change nothing
sudo bin/deploy-fleet.sh --site=example.com     # only matching site(s) — canary first
sudo bin/deploy-fleet.sh                         # all sites
sudo bin/deploy-fleet.sh --remove --site=foo    # remove from matching site(s)

Run with sudo — it writes into other users' directories and chowns.

What it does per site

Discovers sites via /home/*/*/public/wp-config.php, then for each:

wp-content/mu-plugins/bext.php       ← mu-loader.php (auto-loaded)
wp-content/mu-plugins/bext-wp/…      ← rsync of the package (runtime files only)

chowned to the directory owner. It excludes dev files (.git, tests, bin, .github, node_modules, vendor). It's idempotent — re-run any time (e.g. at a new tag) to update.

Recommended rollout

  1. --list to confirm the targets.
  2. --site=<one> canary; verify on the Dashboard and with wp bext doctor.
  3. Full run.
  4. Smoke a sample: curl -sko /dev/null -w '%{http_code}\n' "https://<host>/?cb=$(date +%s)" — expect non-5xx.

Notes

  • Some hosts own a site's public/ as root:root; copied files are world-readable, so PHP-FPM still loads them.
  • The script reads the version from the plugin header (bext-wp.php) for its install log.
  • A site's directory name on disk may differ from its served domain — smoke-test the live domain, not the directory name (see Troubleshooting).

Clone this wiki locally