-
Notifications
You must be signed in to change notification settings - Fork 1
Deploying
- Deploying id3c or id3c-customizations
- Deploying husky-musher
- Deploying scan-switchboard
- Deploying specimen-manifests
- id3c source code
- id3c-customizations source code
Before you get started, you'll need the following:
- a personal admin account to the production ID3C database plus the login information for the
postgresuser account. - a configured
sqitchenvironment on your local machine.See Infrastructure → Databases (PostgreSQL) → sqitch configuration
- a public key shared with the
ubuntuaccount onbackoffice.seattleflu.org.
- Merge code changes in id3c or id3c-customizations to each master branch, respectively.
- Run
pipenv updatein theid3c-productiondirectory of your backoffice checkout. This will lock ID3C and our customizations at the latest state of their master branch on GitHub. Review, commit, and push the changes.
If you have no schema changes to deploy, you may skip this section.
-
Deploy database schema changes via
sqitchfrom your local machine. Run the following commands, replacing the curly-bracketed text with your specifications.First, check that the plan looks good.
PGUSER={your-admin-username} sqitch status {database name}Tip: check
~/.pg_service.conffor your admin username and other connection detailsIf everything looks good, run the following using the
postgresuser.PGUSER=postgres sqitch deploy {database name} -
Grant any newly needed roles to the
backofficedatabase automation user viaPGUSER={your-admin-username} PGSERVICE={service name} psqlOnce inside of the
psqlprompt, run:grant "{role}" to "backoffice-etl";
If you have no code changes to deploy, you may skip this section.
- Log onto the
backofficeserver. - Navigate to the
/opt/backofficedirectory and rungit pull. - Add any newly needed secret environment variables under
id3c-production/env.d/…. (Non-secret environment variables should be committed and pulled in via git.) - Install the latest production environment with
(cd id3c-production; pipenv sync). - Install the latest crontabs with
sudo make -C crontabs. - If there are updates to the web API, restart the web API backend by running
sudo systemctl reload uwsgi.See the uWSGI documentation under Infrastructure → Hosts → backoffice.seattleflu.org
- If the API was restarted, check web API log file with
sudo tail -f /var/log/uwsgi/app/api-production.log.
If you have no data to upload, you may skip this section.
- Upload data to the
receivingarea of the database from your local machine. Run the desiredid3ccommand(s) with a prefix ofPGSERVICE={service name}.
- husky-musher source code
- Log onto the
backofficeserver. - Navigate to the
/opt/husky-musherdirectory and rungit pull. - Reload the uWSGI server by running
sudo systemctl reload uwsgi.See the uWSGI documentation under Infrastructure → Hosts → backoffice.seattleflu.org
- Check log file at
/var/log/uwsgi/app/husky-musher.logfor any errors or warnings.
- scan-switchboard source code
- Log onto the
backofficeserver. - Navigate to the
/opt/scan-switchboarddirectory and rungit pull. - Add any newly needed secret environment variables under
/opt/backoffice/id3c-production/env.d/…. (Non-secret environment variables should be committed and pulled in via git.) - Install the latest code with
pipenv sync. - If you've changed the structure of the
record_barcodestable in the SQLite database, delete the old database file underdata/. - Restart scan-switchboard with
sudo systemctl restart scan-switchboard
There is a crontab that syncs the switchboard. If you have changed something in scan-switchboard that needs accompanying changes to the crontab, make that change in the backoffice repository and deploy that too.
- specimen-manifests source code
- Log onto the
backofficeserver. - Navigate to the
/opt/specimen-manifestsdirectory and rungit pull.