fix pm2 setup and execution from auto init script

pull/28/head
HardiReady 2018-02-24 14:06:07 +01:00
parent b0c149f05d
commit 1617296db3
1 changed files with 5 additions and 2 deletions

7
docs/infra/3rd-party-install.sh Normal file → Executable file
View File

@ -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