Meza/Autodeployer

Meza has a feature called "Autodeployer" which will check for changes to Meza or your public config repository and automatically deploy those changes.

Requirements

 * 1) Your public config  must be stored in a Git repository
 * 2) File permissions to Meza and public config must be such that the user running autodeploy (root recommended for now) can modify the repositories
 * 3) If your config is in a private repository, you'll need to configure SSH keys
 * 4) You must be running Meza 31.1.0 or greater

Secret config
Add to your Meza/Secret config the info about your Meza/Public config:

This could be put in your public config since it's not sensitive information, but since it drives what version of your public config to use it causes a chicken-or-egg situation if you put it there.

Additionally, if you use Slack, you can setup notifications with the following. Additional notification systems (like email) intend to be created at some point.

This is sensitive information (the token, anyway) and thus should be in your secret config.

Public config
Within your public config you should define which version of Meza to track.

The config above tracks the  version of Meza. Any changes pushed to the  branch of Meza will automatically be deployed to your server. Alternatively, if you want to use a specific version of Meza you could do the following:

Setup crontab
Crontab is used to declare how often to check for changes. Hourly is recommended, to reduce the likelihood that two deploys occur concurrently. At some point Meza will prevent this from happening and more frequent autodeploys will be able to be scheduled.

Run  to edit the root user's crontab, then paste the following to run an hourly check for changes:

0 * * * * /opt/meza/src/scripts/autodeployer/check-for-changes.sh > /opt/data-meza/logs/check-for-changes-`date "+\%Y-\%m-\%d_\%H\%M\%S"`.log 2>&1

Running nightly overwrite-from-another-server
If you configure to be able to pull data from another server (see Meza/Importing data), you can create a backup server that pulls data from your production server nightly (or any other frequency). After the import settings are configured (again, see Meza/Importing data), simply add the following to root's crontab:

0 22 * * * /opt/meza/src/scripts/autodeployer/do-deploy.sh "Backup" "--overwrite --skip-tags smw-data,search-index" "deploy-overwrite-"
 * 1) Backup from production every night at 22:00. Don't run SMW rebuild data or search indexing