Reputation: 621
I have used pm2 for node.js application to build with help of jenkins pipeline. For my application to start, it needs the another application to running on the particular port. For achieving this with CI on jenkins I used pm2 to run the process in background so it can go for next stage.
In my local machine pm2 is running successfully .But in jenkins it is not starting the application, and also it does not shows any error message, but I am sure the application was not running with pm2. What may be a reason.
Any Help.
Thanks.
Upvotes: 1
Views: 1799
Reputation: 317
Try
pm2 startup
And execute the suggested command.
If you are using NVM and you execute a shell script with Jenkins, add this at the beginning.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
Upvotes: 1