mirror of
https://github.com/20kaushik02/CSE546_Cloud_Computing_Projects.git
synced 2026-01-25 14:44:04 +00:00
did not do part 2. but must complete even if of no use.
This commit is contained in:
29
Project-1/Part-2/web_tier_instance_run
Normal file
29
Project-1/Part-2/web_tier_instance_run
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# https://stackoverflow.com/a/71648116/7630441
|
||||
sudo -u ubuntu -i <<'EOF'
|
||||
|
||||
# initializing instance
|
||||
cd ~
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3-pip
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
# Project specific setup
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
echo -e '\nexport NVM_DIR="$HOME/.nvm"\n[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm \n[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion\n' >> .bashrc
|
||||
source ~/.bashrc
|
||||
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
|
||||
nvm install v20.11.0
|
||||
|
||||
npm i -g pm2
|
||||
git clone https://github.com/20kaushik02/CSE546_Cloud_Computing_Projects repo
|
||||
cd repo/Project-1/Part-2/web-tier-express
|
||||
npm i
|
||||
|
||||
# Start
|
||||
pm2 start npm --name webTier -- run prod
|
||||
pm2 save
|
||||
|
||||
EOF
|
||||
Reference in New Issue
Block a user