Development Cycle
This is my current approach to development and deployment. I am currently running two servers for this site. My development server is currently an Ubuntu 22 VM, called sidev, that runs under VMWare Fusion on my Mac laptop, which is called dendrite. My production server is a UW hosted Ubuntu 20 server called synapse. All content creation and editing should be done on the production server, and all code development should be done on the development server. Code is maintained in git repositories, with a central GitHub repository called sigwag.
Transferring of content from synapse to sidev is done by:
- Backing up the production server onto dendrite, including a dump of the database onto the serverbackups directory using my myserversrsync.sh script, as detailed in the blog on Backup. This script creates a dump of the synapse postgres database in the serverbackups directory.
- From sidev cd /mnt/hgfs/brinkley/Documents/serverbackups/synapse/opt/sigwag/backup
- Run: psql -U siguser sig < pgbackup.sql
- If any media files were changed on synapse copy (or rsync) the synapse sigwag/media directory from serverbackups to sidev
This should populate the sidev database with content from synapse, and transfer any added media. Even though the versions of postgres on the two machines are (currently) different, various web sources tell me it should work to transfer an older postgres dump to a newer one, but not necessarily the reverse. So far it seems to be working.
Updating of production code on synapse with new or edited code on sidev should be done via GitHub:
- Sidev has the master branch, which should be set to track the GitHub master branch, called origin/master.
- Make any commits on the sidev master branch
- Push these commits to origin/master
- On synapse, switch to the master branch, which should also be tracking origin/master. Pull the changes from origin/master. There should be no conflicts since in general development on the master branch should only be on sidev.
- There is also a ubuntu20 branch on synapse which is slightly different than the master branch, since it has to take into account the different versions of Ubuntu. (For example Ubuntu 20 comes with Python 3.8, and Wagtail 6.4 doesn't run with Python 3.8, so I can only install Wagtail less than 6.4 on synapse.). This is reflected in a different requirements.txt file on the two branches. This branch tracks the corresponding GitHub branch origin/ubuntu20.
- On synapse switch to the Ubuntu20 branch, then git merge master to this branch. Seems to work fine without conflicts.
- Push the merged ubuntu20 branch to origin/ubuntu20.
- Restart apache: systemctl restart apache2.
- The changes should now be visible in the production website.
Created 2025Feb24
Last modified 2025Feb25