Skip to content

Commit

Permalink
Update update script
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenAnhTuan1912 committed Aug 17, 2024
1 parent 14d7572 commit 6fdb294
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
14 changes: 13 additions & 1 deletion backend/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#!/bin/bash

# Change directory to `backend`
cd /home/backend

# Install NodeJS Server
bash nodejs/scripts/install.sh

# Change directory to `backend`
cd /home/backend

# Install Python
bash python/scripts/install.sh
bash python/scripts/install.sh

# Change directory to `backend`
cd /home/backend

# Start server
bash nodejs/scripts/start.sh
11 changes: 4 additions & 7 deletions backend/nodejs/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ printf "NVM has just been installed: $(nvm -v)"
### Install node 20
nvm install node 20

### Change directory to `nodejs`
cd /home/backend/nodejs

### Check version of `node` and `npm`
printf "Node has just been installed: $(node -v)"
printf "NPM has just been installed: $(npm -v)"

## Install packages in `package.json`
npm install
npm install -g pm2

## Start server
npm start

## Enable log
pm2 logs
npm install -g pm2
9 changes: 9 additions & 0 deletions backend/nodejs/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Change directory to `nodejs`
cd /home/backend/nodejs

# Start NodeJS Server
npm start

pm2 logs
4 changes: 2 additions & 2 deletions backend/python/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ printf "Python has been just installed: $(python3 --version)"
apt install python3-pip
printf "PIP has just been installed: $(node -v)"

## Move to `python`
cd ../
# Change directory to `backend`
cd /home/backend/python

## Install packages in `requirements.txt`
pip3 install -r requirements.txt
Expand Down

0 comments on commit 6fdb294

Please sign in to comment.