fix pm2 setup and execution from auto init script
parent
b0c149f05d
commit
1617296db3
|
@ -26,13 +26,16 @@ sudo systemctl enable mongod.service
|
||||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
||||||
source ~/.nvm/nvm.sh
|
source ~/.nvm/nvm.sh
|
||||||
nvm install stable
|
nvm install stable
|
||||||
sudo ln -s ~/.nvm/versions/node/$(node -v)/bin/node /usr/bin/node
|
sudo ln -sf ~/.nvm/versions/node/$(node -v)/bin/node /usr/bin/node
|
||||||
|
|
||||||
# upgrade to latest npm version
|
# upgrade to latest npm version
|
||||||
sudo npm install -g npm@latest
|
sudo npm install -g npm@latest
|
||||||
|
|
||||||
if [ "${1}" == "prod" ]; then
|
if [ "${1}" == "prod" ]; then
|
||||||
|
cd ./../..
|
||||||
|
npm install
|
||||||
|
npm run deploy-static:prod
|
||||||
sudo npm install -g pm2
|
sudo npm install -g pm2
|
||||||
pm2 start ./../../pm2-start.json
|
pm2 start pm2-start.json
|
||||||
pm2 startup systemd
|
pm2 startup systemd
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue