Deploy Scripts
Scripts for deploying, syncing, and managing Joomla and Dolibarr sites.
All deploy scripts live in
deploy/and follow the same CLI conventions:--config,--dry-run,--verbose, and sftp-config.json format.
Scripts
deploy-joomla.php
Smart Joomla deploy -- routes files to correct Joomla directories based on XML manifest.
php deploy/deploy-joomla.php --path . --config /tmp/sftp-config.json
php deploy/deploy-joomla.php --path . --config /tmp/sftp-config.json --dry-run
deploy-sftp.php
Generic SFTP deployment -- uploads src/ directory to a remote server.
php deploy/deploy-sftp.php --path . --config sftp-config.json
php deploy/deploy-sftp.php --path . --env dev
deploy-dolibarr.php
Deploy Dolibarr module files to a remote server. Auto-detects module name from core/modules/mod*.class.php.
php deploy/deploy-dolibarr.php --source ./src --config sftp-config.json
php deploy/deploy-dolibarr.php --source ./src --config sftp-config.json --dry-run
Maps: core/modules/, class/, lib/, sql/, langs/, css/, js/, img/ to htdocs/custom/{module}/.
sync-joomla.php
Sync Joomla directories between two servers via rsync over SSH relay. Always excludes configuration.php.
php deploy/sync-joomla.php --source src.json --dest dest.json --rsync
php deploy/sync-joomla.php --source src.json --dest dest.json --full --dry-run
See JOOMLA_SYNC for full documentation.
backup-before-deploy.php
Snapshot Joomla directories from a server before deploying, for rollback capability.
php deploy/backup-before-deploy.php --config sftp-config.json
php deploy/backup-before-deploy.php --config sftp-config.json --output /tmp/my-snapshot
Output path is printed at the end -- feed it to rollback-joomla.php if needed.
rollback-joomla.php
Rollback a Joomla deployment by restoring from a pre-deploy snapshot.
php deploy/rollback-joomla.php --config sftp-config.json --snapshot-dir /tmp/moko-snapshot-20260519
php deploy/rollback-joomla.php --config sftp-config.json --snapshot-dir /tmp/moko-snapshot-20260519 --dry-run
Always excludes configuration.php.
health-check.php
Post-deploy health check -- verify a Joomla site is responding correctly.
php deploy/health-check.php --url https://clarksvillefurs.com
php deploy/health-check.php --url https://example.com --checks http,admin,api --timeout 30
Checks: http (200 + no PHP fatals), admin (administrator/ accessible), api (API responding).
Typical Deploy Workflow
# 1. Snapshot current state
php deploy/backup-before-deploy.php --config sftp-config.json
# Output: /tmp/moko-snapshot-1716148800
# 2. Deploy
php deploy/deploy-joomla.php --path . --config sftp-config.json
# 3. Health check
php deploy/health-check.php --url https://example.com --checks http,admin
# 4. If something is wrong, rollback
php deploy/rollback-joomla.php --config sftp-config.json --snapshot-dir /tmp/moko-snapshot-1716148800
Related
- JOOMLA_SYNC -- Server-to-server sync documentation
- SITE_MONITORING -- Post-deploy monitoring
- WORKFLOW_STANDARDS -- CI/CD workflow conventions
Repo: moko-platform
| Revision | Date | Author | Description |
|---|---|---|---|
| 1.0 | 2026-05-19 | Moko Consulting | Initial version |