Page:
DEPLOY-SCRIPTS
Clone
3
DEPLOY-SCRIPTS
Jonathan Miller edited this page 2026-06-21 02:21:16 +00:00
Table of Contents
Deploy Scripts
Scripts for deploying, syncing, and managing Joomla and Dolibarr sites.
Scripts
| Script | Purpose |
|---|---|
deploy/deploy-joomla.php |
Smart Joomla deploy via XML manifest |
deploy/deploy-sftp.php |
Generic SFTP deployment |
deploy/deploy-dolibarr.php |
Deploy Dolibarr modules |
deploy/sync-joomla.php |
Sync between servers (excludes configuration.php) |
deploy/backup-before-deploy.php |
Snapshot server before deploying |
deploy/rollback-joomla.php |
Restore from pre-deploy snapshot |
deploy/health-check.php |
Post-deploy HTTP/admin/API verification |
Environments
deploy-sftp.php supports 4 environments via --env:
| Env | Config File | Notes |
|---|---|---|
dev |
scripts/sftp-config/sftp-config.dev.json |
Development server |
demo |
scripts/sftp-config/sftp-config.demo.json |
Demo/staging server |
rs |
scripts/sftp-config/sftp-config.rs.json |
Production (single) |
live |
scripts/sftp-config/sftp-config.live.json or LIVE_TARGETS env |
Production (multi-instance) |
Usage
# Single-target deploy
php bin/moko deploy:sftp --path . --env dev
php bin/moko deploy:sftp --path . --env demo
php bin/moko deploy:sftp --path . --env rs--dry-run
# Multi-instance live deploy (via LIVE_TARGETS env var)
export LIVE_TARGETS='[{"host":" web1","user":"deploy","remote_path":"/var/www/module/","ssh_key_file":"~/.ssh/id_rsa"}]'
php bin/moko deploy:sftp --path . --env live
Multi-Instance Live Deploy
When LIVE_TARGETS env var is set (typically from a Gitea Actions secret), deploy-sftp.php iterates over each target and deploys sequentially.
Format (JSON array):
[
{"host": "web1.example.com", "user": "deploy", "remote_path": "/var/www/module/", "ssh_key_file": "~/.ssh/id_rsa"},
{"host": "web2.example.com", "user": "deploy", "remote_path": "/var/www/module/", "ssh_key_file": "~/.ssh/id_rsa"}
]
Each target uses the same config format as sftp-config.*.json. Failed targets are logged but don't stop the remaining deploys.
Typical Workflow
backup-before-deploy.php— snapshot current statedeploy-joomla.phpordeploy-sftp.php— deploy changeshealth-check.php— verify site is respondingrollback-joomla.php— rollback if health check fails
Related
- JOOMLA_SYNC — Server-to-server sync
- MONITORING_SCRIPTS x Post-deploy monitoring
Pages
- CLI-AUTOMATION
- DEPLOY-SCRIPTS
- api
- automation
- features
- guides
- operations
- reference
- standards
- templates
- unnamed
-
workflows
- workflows-README.-
- workflows-README
- workflows-auto-release.-
- workflows-auto-release
- workflows-branch-protection.-
- workflows-branch-protection
- workflows-build-release.-
- workflows-build-release
- workflows-cascade-dev.-
- workflows-cascade-dev
- workflows-changelog-management.-
- workflows-changelog-management
- workflows-demo-deployment.-
- workflows-demo-deployment
- workflows-dev-branch-tracking.-
- workflows-dev-branch-tracking
- workflows-dev-deployment.-
- workflows-dev-deployment
- workflows-index.-
- workflows-index
- workflows-release-system.-
- workflows-release-system
- workflows-renovate.-
- workflows-renovate
- workflows-reusable-workflows.-
- workflows-reusable-workflows
- workflows-rs-deployment.-
- workflows-rs-deployment
- workflows-secret-scanning.-
- workflows-secret-scanning
- workflows-shared-workflows.-
- workflows-shared-workflows
- workflows-standards-compliance.-
- workflows-standards-compliance
- workflows-static-analysis.-
- workflows-static-analysis
- workflows-sub-issue-management.-
- workflows-sub-issue-management
- workflows-update-server.-
- workflows-update-server
- workflows-workflow-architecture.-
- workflows-workflow-architecture