Staging Deployment (deploy_staging.sh)
Overview
Testing updates, new themes, or structural changes directly on production is dangerous. The deploy_staging.sh script performs a rapid, 1-to-1 sync from your Production environment to your Staging environment.
Warning
Running this script will completely overwrite the staging database and all staging files.
Execution
BASH
sudo bash /var/www/pragma-cms/scripts/cli/deploy_staging.sh
Syncing Logic
- Database Cloning: Uses a direct pipe (
mysqldump ... | mysql ...) to clone thepragma_cms_platformdatabase directly intopragma_cms_platform_stagingentirely in memory, without writing intermediary.sqlfiles to disk. - Fast File Sync: Uses
rsync -av --delete. This compares files and transfers only what has changed, making it incredibly fast. - Safety Exclusions: It explicitly prevents overwriting the staging database credentials by excluding
config_db.php. It also skips transferring production caches and logs. - Permission Reset: Ensures the staging directory is given back to the
www-datauser to prevent web server permission denied errors.