Default template

Deploying Library

By naitian.

Last edited by ericlau. Created .

This is for web team members. If you are not part of the web team, feel free to disregard.

Library is hosted on an AWS EC2 instance. The source code is located on GitHub in 2 repositories. The main code is in MichiganDaily/library which is a direct fork of The New York Times’s repository. We do not make changes to this repository, besides fetching upstream changes. Instead, our changes are made in MichiganDaily/library-customization.

Our code is cloned onto the AWS server and nginx serves as a reverse proxy for the web app, which listens on localhost:3000.

Here are the steps to deploy changes to Library:

  1. Make sure the code is pushed to the main branch of the MichiganDaily/library-customization repository.
  2. SSH as ubuntu@library.michigandaily.com
  1. You need to have the .pem certificate in order to authenticate with the server. Reach out to one of the MOEs for this file.
  2. For example: ssh -i /path/library-key.pem ubuntu@library.michigandaily.com
  1. cd into the library/ directory
  2. Run git pull to fetch any changes if MichiganDaily/library was updated.
  3. Run ./bin/install_customizations to install changes from MichiganDaily/library-customization
  1. If the CUSTOMIZATION_GIT_REPO environment variable isn’t set, this won’t work. Make sure CUSTOMIZATION_GIT_REPO=https://github.com/MichiganDaily/library-customization
  1. Run yarn to install the necessary libraries.
  2. Run yarn run build to build static files.
  3. If you made no changes to environment variables, run pm2 restart library to restart the Library process. Otherwise, run pm2 restart production.config.js --update-env
  4. You’re done! Navigate to library.michigandaily.com to make sure your changes are reflected (and do not break anything!)