lebenswurzel / solawi-bedarf

Eine App für die Produktverwaltung und Bedarfsanmeldung in einer SoLawi
GNU Affero General Public License v3.0
2 stars 0 forks source link

Standardize building and deployment #53

Closed joergrs closed 4 days ago

joergrs commented 4 weeks ago

To minimize manual steps when deploying a new version, we need some scripting that automates most of the tasks.

Deployment steps

Manual steps:

  1. SSH into the server
  2. Check out the desired branch or tag
  3. Run deployment script

The deployment script should do:

  1. Backing up the current database
  2. Stopping the current containers
  3. Building the containers
  4. Starting up the new containers
  5. Some sanity checks

Show version info in the app

Also, display the build version and date in the footer of the app.

Nice-to-have: In order to avoid that a user uses an out-of-date frontend version (e.g., from local cache), the backend should also send its version and build info for verification purposes to the frontend. This might be a rare case, though.

joergrs commented 3 weeks ago

Regarding database backups: the current way of snapshotting the file system is potentially unsafe and might lead to corrupted data: https://www.postgresql.org/docs/current/backup-file.html

So either an SQL dump of the database should be used (https://www.postgresql.org/docs/current/backup-dump.html) or the containers must be stopped before creating the backup.