-
Notifications
You must be signed in to change notification settings - Fork 1
Deploying
Deploying id3c or id3c-customizations
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";
Code changes to id3c
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. - Reload the web API backend by running
sudo systemctl restart uwsgi.See the uWSGI documentation under Infrastructure → Hosts → backoffice.seattleflu.org
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}.
Deploying husky-musher
- Log onto the
backofficeserver. - Navigate to the
/opt/husky-musherdirectory and rungit pull. - Reload the uWSGI server by running
sudo systemctl restart uwsgi.See the uWSGI documentation under Infrastructure → Hosts → backoffice.seattleflu.org
- 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. - 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.
Deploying specimen-manifests
- Log onto the
backofficeserver. - Navigate to the
/opt/specimen-manifestsdirectory and rungit pull.