-
Notifications
You must be signed in to change notification settings - Fork 3
Deployment Guide
Below is a guide to getting set up with our development process so that you can start contributing to our project 😄.
Before you can build & deploy the project, you must fulfill the following requirements:
1. Install nodejs
Once node is installed on your computer, navigate to the root directory of the project and run the command npm install. This will make sure that all the node-specific dependencies for our project are downloaded onto your computer. The dependencies will be placed in a folder called node_modules.
Note that in this case node is not being used as a server, but instead as a sort of compiler via babel and browserify.
This is needed for step 1 of buildAndDeploy.sh's operations below.
2. Install maven
This is used as a java package manager as well as a compiler/build tool.
This is needed for step 2 of buildAndDeploy.sh's operations below.
Username/Password signon is disabled for our server for security, so you will need to authenticate via private key. Github provides a great guide on how to generate such a key. Once you have your key generated (it will probably located at ~/.ssh/id_rsa.pub), send the public key (.pub) to Stu, Peter or David so one of them can add you to our list of allowed users. To verify that you have access, try to ssh into the server: ssh david@conucourseplanner.online.
This is needed for step 3 of buildAndDeploy.sh's operations below.
Simply ask Stu, Peter, or David to create you a personal url to deploy to.
OR
If you've completed step 3 already then you can do this yourself as long as you know the password for david on the server (needed to use sudo). Simply use the first letter of your name to form the name of your folder: courseplanner{firstLetter}. The following are already taken: courseplannerd, courseplanners, courseplannerp, courseplannerj, courseplannerm. Then run the following command: sudo cp -p ROOT.war couresplanner{firstLetter}.war. Give Tomcat about a minute to load the new site, then visit your unique testing URL: conucourseplanner.online/courseplanner{firstLetter}
This is needed for step 3 of buildAndDeploy.sh's operations below.
To build the project and deploy it to your url, use our deploy script: buildAndDeploy.sh.
This shell script requires 1 command line option in order to execute. This option defines how the project will be built (either development mode or production mode) as well as its final destination (this affects the URL you will type into the browser to view the site).
You can also add the optional --verbose command if you wish to see the output of all the programs that the script executes.
- To deploy to production:
sh buildAndDeploy.sh prod- Then visitconucourseplanner.onlineto view the site. - To deploy to your personal URL:
sh buildAndDeploy.sh yourName- then take the first letter of yourName and visitconucourseplanner.online/courseplanner{firstLetter}to view the site. For example,sh buildAndDeploy.sh davidwould result in the urlconucourseplanner.online/couresplannerd
- Build/compile the frontend React code.
- Build/compile the backend Java EE code and package it all together with the frontend assets (html, css, js) into a final build file:
courseplanner.war- .war is similar to .zip so you can inspect it with winrar or an equivalent program - Deploy the .war file to our remote server via
scp.
Note that since webscraping isn't part of the webapp, there is no need to read this section unless you are actually changing anything in this folder.
Before you can run the webscrapers you'll need to get a hold of the DB password for write access and store it in a file (e.g. tranzoneAdminPass.txt). You can then run the webscrapers via sh scrapeTheWeb.sh "$(< tranzoneAdminPass.txt)" with or without the --prod option. You can also run the individual scrapers and storers if you wish, just check out the contents of scrapeTheWeb.sh to learn how to do so.
You can sync up the webscraper which runs in the cron job with whatever you have locally by running deployScraper.sh.
- General Project Docs
- Deployment Guide
- Local Frontend Testing Guide
- REST API Spec
- Dev Tips/Miscellaneous