Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenAnhTuan1912 committed Aug 18, 2024
1 parent 81d0867 commit 223e219
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

. ./utils.sh
. utils.sh

# Change directory to `backend`
infoln "Change directory to /home/backend"
Expand Down
16 changes: 10 additions & 6 deletions backend/nodejs/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

. /home/backend/utils.sh

## Update packages
apt update

Expand All @@ -14,18 +16,20 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

printf "NVM has just been installed: $(nvm -v)"
# infoln "NVM has just been installed: $(nvm -v)"

### Install node 20
nvm install node 20

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

### 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
npm install -g pm2

infoln "Install packages: $(npm list -g)"
File renamed without changes.
7 changes: 0 additions & 7 deletions docker_install.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
#!/bin/bash

. utils.sh

## Update packages
infoln "Check package"
sudo yum update -y

## Install docker
infoln "Install docker"
sudo yum install -y docker

## Start docker daemon
infoln "Start docker daemon"
sudo service docker start
## Or
# sudo systemctl start docker

## Create docker group
infoln "Create docker group"
sudo groupadd docker

## Add user to docker
infoln "Add user to group"
sudo usermod -aG docker $USER

## Apply new change
Expand Down

0 comments on commit 223e219

Please sign in to comment.