diff --git a/.scripts/deploy.sh b/.scripts/deploy.sh index 224dd20..814f384 100755 --- a/.scripts/deploy.sh +++ b/.scripts/deploy.sh @@ -2,14 +2,15 @@ set -e -PM2_PATH=/root/.nvm/versions/node/v18.10.0/bin/pm2 +NODE_PATH=/root/.nvm/versions/node/v18.10.0/bin/node +# PM2_PATH=/root/.nvm/versions/node/v18.10.0/bin/pm2 NPM_PATH=/root/.nvm/versions/node/v18.10.0/bin/npm echo "Deployment started ..." # Enter maintenance mode or return true # if already is in maintenance mode -($PM2_PATH stop server.js --message 'The app is being (quickly!) updated. Please try again in a minute.') || true +($NODE_PATH $NPM_PATH run stop --message 'The app is being (quickly!) updated. Please try again in a minute.') || true # Pull the latest version of the app git fetch origin master @@ -17,9 +18,9 @@ git reset --hard origin/master git pull origin master # Compile npm assets -$NPM_PATH install --omit=dev +$NODE_PATH $NPM_PATH install --omit=dev # Exit maintenance mode -$PM2_PATH start server.js +$NODE_PATH $NPM_PATH run start echo "Deployment finished!"