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