A rolling deploy pushes updated MediaWiki code to production servers one at a time (or in small batches), temporarily removing each server from HAProxy before syncing and returning it to the pool only after a canary health check passes. This page walks through the full procedure from pre-deploy checks through post-deploy verification, including what to do when something goes wrong.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
Pre-Deploy Checklist
Before starting a deploy, confirm that the environment is in a healthy baseline state. Deploying into an already-degraded fleet risks turning a partial outage into a complete one.Verify all servers are pooled and healthy in HAProxy
On any proxy server, check the current pool status using the Salt Every application server in the
haproxy module:mediawiki backend should show status: UP. Investigate any server showing DOWN, MAINT, or DRAIN before proceeding.Check monitoring for active alerts
Review the Icinga2 dashboard for any open CRITICAL or WARNING alerts on MediaWiki application servers or their upstream services (databases, object caches, NFS). A deploy that touches an already-sick service can mask the underlying issue and complicate diagnosis.
Confirm staging is up to date
On the staging server, verify that the branches you intend to deploy are at the expected commits:
Running the Deploy
1. SSH to the staging server as mwdeploy
All deployments must be run from the staging server. The mwdeploy user owns the staging checkout and holds the SSH key trusted by all production servers.
2. Choose your deploy flags
Pick the flags that match what changed. Minimal flag sets produce faster, lower-risk deploys.- Full code deploy
- Extension or skin only
- Config only
- Rsync only
- Targeted servers
Pull core and the active MediaWiki version, rebuild the localisation cache, then roll out to all servers through HAProxy:
3. Watch the TUI dashboard
The curses dashboard opens automatically when you pass deploy flags. It shows live status for every server.↑/↓ to select a server and Ctrl+O to open the full log view for that server.
The Canary Check
Before deploying to any production server,mwdeploy performs a canary check on the staging host itself. It then repeats the check on each production server immediately after rsyncing and before repooling.
The check works as follows:
curlfetcheshttp://127.0.0.1/wiki/Main_Pageon the target host with aHost: test.wikioasis.orgheader and a 15-second timeout.- The HTTP response code must be
200. - The response body must contain the string
wikioasis(case-insensitive). - Up to 3 attempts are made with a 3-second pause between failures.
Canary Failure Prompt
When a canary fails and--force is not set, the dashboard freezes and displays an interactive prompt:
- Press Y to skip this server and continue deploying to the next. The failed server’s status is set to
failedand it is repooled immediately (if--rolloutwas set). - Press N to abort. All pending servers are marked
skipped. Any server already inrunningstate finishes its current step before stopping.
--force to bypass prompts entirely.
HAProxy Depool/Repool Integration
When--rollout is passed, mwdeploy integrates with HAProxy’s runtime socket to take each server out of rotation during its deploy window, avoiding sending user requests to a server mid-rsync.
The sequence for each server is:
- Depool —
disable server mediawiki/<server>is sent to every proxy inproxy_serversviasocat stdio /run/haproxy/admin.sock. Existing connections drain naturally; no new requests are sent to the server. - Rsync — files are pushed. Because the server is out of rotation, no users are affected by a partially updated file tree.
- Canary — the health check runs locally on the production server, not through HAProxy, so it tests the new code directly.
- Repool —
enable server mediawiki/<server>returns the server to full rotation.
--force is set).
Manual Pool Control from the TUI
You can manually depool or repool any server at any time from the dashboard by selecting it and pressingCtrl+R:
Notification Webhooks
mwdeploy posts deploy events to Discord and/or Slack webhooks configured under webhooks in /etc/mwdeploy/config.yaml. The following events generate notifications:
| Event | Level |
|---|---|
| Deploy starting (with target server list) | INFO |
| Deploy complete (with server count) | INFO |
| Deploy finished with failures (with failed server list) | ERROR |
| Individual canary failures | WARNING |
--no-log.
Post-Deploy Verification
After the TUI shows all servers as✓ done, run a brief verification pass before considering the deploy complete.
Check the deploy summary
The bottom of the TUI dashboard shows a summary line:Any non-zero failed count warrants investigation before declaring the deploy successful.
Spot-check a live page
Load a representative wiki page in a browser or with curl to verify MediaWiki is responding correctly on the live vhost:
Verify all servers are back in the pool
Confirm that every application server is showing
UP in HAProxy after the deploy:Rollback
mwdeploy does not have an automated rollback command. The rolled_back status shown in the TUI refers to a server that was repooled after a failure — it does not mean code was reverted.
To roll back to the previous code state:
- On the staging server, revert the git change in staging:
- Re-run
mwdeploy --rsync --servers all --rolloutto push the previous content to all servers.
--extension <Name> to target just that path.