Page:
DEPLOY-SCRIPTS
Pages
AUTO-CREATE-ORG-PROJECTS
Branching-Strategy
CLI-AUTOMATION
Coding-Standards
DEPLOY-SCRIPTS
DOLIBARR-MODULE-IDS
DRY-RUN-PATTERN
Documentation-Standards
File-Header-Standards
JOOMLA-SYNC
LEGAL-DOC-GENERATOR-WEB-README
MONITORING-SCRIPTS
NEW-SCRIPTS
QUICKSTART-ORG-PROJECTS
RELEASE-MANAGEMENT
Version-Standard
WIKI-STANDARDS
WORKFLOW-STANDARDS
api-maintenance-index
api-plugin-index
api-tests-index
api-tests-sample-index
automation-README
automation-branch-version-automation
automation-repo-cleanup
client-repos
standards-mokostandards-file-spec
templates-client-waas
templates-dolibarr
templates-generic
templates-mcp
unnamed
workflows-README
workflows-auto-release
workflows-branch-protection
workflows-build-release
workflows-cascade-dev
workflows-changelog-management
workflows-demo-deployment
workflows-dev-branch-tracking
workflows-dev-deployment
workflows-index
workflows-release-system
workflows-renovate
workflows-reusable-workflows
workflows-rs-deployment
workflows-secret-scanning
workflows-shared-workflows
workflows-standards-compliance
workflows-static-analysis
workflows-sub-issue-management
workflows-update-server
workflows-workflow-architecture
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
- AUTO-CREATE-ORG-PROJECTS
- Branching-Strategy
- CLI-AUTOMATION
- Coding-Standards
- DEPLOY-SCRIPTS
- DOLIBARR-MODULE-IDS
- DRY-RUN-PATTERN
- Documentation-Standards
- File-Header-Standards
- JOOMLA-SYNC
- LEGAL-DOC-GENERATOR-WEB-README
- MONITORING-SCRIPTS
- NEW-SCRIPTS
- QUICKSTART-ORG-PROJECTS
- RELEASE-MANAGEMENT
- Version-Standard
- WIKI-STANDARDS
- WORKFLOW-STANDARDS
- api-maintenance-index
- api-plugin-index
- api-tests-index
- api-tests-sample-index
- automation-README
- automation-branch-version-automation
- automation-repo-cleanup
- client-repos
- features
- operations
- reference
- standards-mokostandards-file-spec
- templates-client-waas
- templates-dolibarr
- templates-generic
- templates-mcp
- unnamed
- workflows-README
- workflows-auto-release
- workflows-branch-protection
- workflows-build-release
- workflows-cascade-dev
- workflows-changelog-management
- workflows-demo-deployment
- workflows-dev-branch-tracking
- workflows-dev-deployment
- workflows-index
- workflows-release-system
- workflows-renovate
- workflows-reusable-workflows
- workflows-rs-deployment
- workflows-secret-scanning
- workflows-shared-workflows
- workflows-standards-compliance
- workflows-static-analysis
- workflows-sub-issue-management
- workflows-update-server
- workflows-workflow-architecture
- workflows