-
Make sure to be connected to the UCF VPN before accessing the server.
-
Open a terminal and type
ssh [username]@chdr.cs.ucf.edu
- Note: all team members are part of the
emurr
group. Hence another way to access the server is: ssh [email protected] - You will be asked for a password:
- Note: all team members are part of the
-
When you log in to CHDR cd to directory
cd /home/emurr/emurr
(1st emurr is for the group folder in CHDR and it cannot be modified, 2nd emurr is the name of our GitHub repo) -
You may use
ls -l
to list all the files in the current dir including the hidden files -
git pull
the latest changes fromdevelop
branch in GitHub- Note 1: If you would, do
git status
andgit branch
to display the state of the current dir and make sure you are pulling from develop. - Note 2: Check the
.env
and.env.local
files are in the root directory
- Note 1: If you would, do
-
Build the project by running
npm run build
. This will create a.next
folder if the build is successful -
Our application is listening on port 4444 and the
package.json
file was modified to include this as shown below:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p 4444",
"lint": "next lint"
},
-
The server is ran using pm2, a daemon process manager to keep the application online.
-
Check the status by running
pm2 status
anywhere in the CHDR Server or runpm2 -h
for a list of available commands -
Currently, there is a process running called
emurr
which should be restarted after each buildpm2 restart <id|name>
. Since the process name is emurr, then runpm2 restart emurr
. -
If there isn't any process running, create a new one by running
pm2 start npm --name "app name" -- start
-
Running the script
deployment.sh
will automate the above process. -
We can run cron job with pm2 and run the script every certain time. For example, the script
deployment.sh
will run every minute with the command below.
pm2 start deployment.sh --cron-restart="* * * * *"