Skip to content

Deployment

Fanny Dolisy edited this page May 4, 2023 · 9 revisions

Getting in

  1. Ensure you are connected to the UTD VPN or UTD wifi
  2. SSH using the provided name and password from the professor
  3. You are now on the server
  4. To access the code base, cd TeamUp

Currently, the server and frontend are running on this server, any code changes on either will require a new deployment *** As of right now you cannot pull from master for deployment, only pull from the deployment branch ***

Dealing with Frontend Code Changes

  1. Pull all code changes using git pull
  2. cd client
  3. pull down your change - git pull
  4. npm install -installs any potential new dependencies
  5. in package.js ensure these lines are correct and present - "homepage": "http://csa-4485-02.utdallas.edu/,"`
  6. For all routes in the pages and components directories, ensure they are not hardcoded to localhost, if they are, update them to have the correct URL - THIS IS VERY IMPORTANT, do not overlook this step, otherwise pages and buttons will not route correctly
  7. Once you have updated all necessary code changes, cd client
  8. Delete all build files in /var/www/html/ - sudo rm -rf /var/www/html/*
  9. Build the frontend - npm run build
  10. cd build
  11. Copy all build files into /var/www/html/ - sudo cp * -r /var/www/html/*
  12. You should be able to see your frontend changes in the deployment link

Dealing with Server Code Changes

  1. run pm2 stop TeamUp - to stop the server from running
  2. pull down your change - git pull
  3. cd server
  4. npm install -installs any potential new dependencies
  5. Ensure the port number in app.js is 1111
  6. to test your change without keeping it running - npm run app (recommended to test before deploying)
  7. to deploy your change - pm2 start app.js --name TeamUp
  8. To ensure the background process is running, run pm2 status and you should see TeamUp in green, otherwise its not running
  9. Your server should now be running and be able to process requests
Clone this wiki locally