This repository houses the the cPanel auto-deployment framework for the DFL Website
The auto-deployment structure is defined by the bash script update.sh, which does the following tasks:
- Run the python scripts to download and populate JSON objects from the DFL master spreadsheet managed by all captains. Objects are found in players.json and schedule.json.
- Pretty-print JSON objects using
python -m json.tool
- Deploy to cPanel by pushing changes made in (1) by this execution of update.sh
On the server-side, a chrontab process updates the website according to this repository every 24 hours, by running its own version of deploy.sh
. The contents of players.json and schedule.json are directly pushed to the server every 24 hours. As such, care must be taken when editing this repository, as well as when updating the google hosted captain's spreadsheet.
This repository allows the DFL captains to input match report data without having to report to the website host. In order to utilize this auto-deployment structure, it is possible to do either of:
- Manually run
./update.sh
at fixed intervals - Use crontab to periodically run
./update.sh
by taking the following steps
- Create a new script,
deploy.sh
with the following:
#!/bin/bash
/Users/user/folder/DFL-cPanel-Auto-Deployment/update.sh
./update.sh
crontab -e
- Find the absolute path to
deploy.sh
, such as/Users/user/folder/DFL-cPanel-Auto-Deployment/deploy.sh
, and paste it into the opened crontab file according to how often the process should run, for example:
1 22 * * * /Users/user/folder/DFL-cPanel-Auto-Deployment/deploy.sh
- Periodically check
/var/mail/
to ensure that the script is running properly.