Skip to content

Deploying an application upgrade to production

Dan Kerchner edited this page Apr 3, 2024 · 6 revisions

Update the version label in config/locales/hyrax.en.yml

Update this property:

local_product_version: "2.1.0"

Tag the code base

Create the tag

tag -a 2.1.0 -m '2.1.0'

Push the new tag to GitHub

git push origin 2.1.0

Create the release and create the docker image.

In the release notes landing page for the draft release note, edit associate the release notes, associate with a tag, and click Publish Release.

This kicks off the Create and publish a Docker image Github action. The run should have the name of the tag, e.g. 2.1.0. This should run fairly quickly.

Confirm that Recent tagged image versions at https://github.com/gwu-libraries/scholarspace-hyrax/pkgs/container/scholarspace-app shows the new image. Copy the path to the image, e.g. ghcr.io/gwu-libraries/scholarspace-app:2.1.0

Edit docker-compose.yml

Update the app docker image tags in docker-compose.yml.

Compare and make changes in docker-compose.yml as needed.

Edit .env

Compare changes in example.env as needed.

Update code from GitHub

git checkout master

git pull origin master (this assumes that the last commit to master is the commit that was tagged for this release)

Rebuild app docker images and bounce docker

docker compose down

docker image ls

docker image rm <scholarspace-app image id>

docker image rm <scholarspace-hyrax-solr image id>

docker volume ls

Remove app-hyrax volume

docker volume rm scholarspace_app-hyrax

Rebuild and bring up docker containers

docker compose -f docker-compose-prod.yml up -d

Watch logs

docker compose logs -f

Precompile assets

docker exec -it --user scholarspace scholarspace-hyrax-app-server bash -l

RAILS_ENV=production rake assets:precompile

Run database migrations

(while in the container)

RAILS_ENV=production rake db:migrate

Apply content block changes

RAILS_ENV=production rake gwss:apply_content_block_changes

Confirm site

Browse to https://scholarspace.library.gwu.edu