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
mainbranch of theMichiganDaily/library-customizationrepository. - SSH as
ubuntu@library.michigandaily.com
- You need to have the
.pemcertificate 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
cdinto thelibrary/directory- Run
git pullto fetch any changes ifMichiganDaily/librarywas updated. - Run
./bin/install_customizationsto install changes fromMichiganDaily/library-customization
- If the
CUSTOMIZATION_GIT_REPOenvironment variable isn’t set, this won’t work. Make sureCUSTOMIZATION_GIT_REPO=https://github.com/MichiganDaily/library-customization
- Run
yarnto install the necessary libraries. - Run
yarn run buildto build static files. - If you made no changes to environment variables, run
pm2 restart libraryto 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!)