I have installed pm2 on my ubuntu machine.
which pm2/usr/local/bin/pm2
This is the shell script to execute inside jenkins workspace.
export BUILD_ID=projectnpm installpm2 start ecosystem.config.js --interpreter=/home/usrname/.nvm/versions/node/v12.20.0/bin/node
With above script, pm2 start the process successfully.
┌─────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐│ id │ name │ namespace │ version │ mode │ pid │ uptime │↺│ status │ cpu │ mem │ user │ watching │├─────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤│ 0 │ projectName│ default │ 1.0.0 │ fork │ 8831 │ 0s │ 0 │ online │ 0% │ 29.4mb │ jenkins │ disabled │└─────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
But, whenever I do pm2 status
on the machine nothings shows up.
I need to check the log of the process.
I think, it is running the pm2
as user jenkins
. Please help.