To run and manage Node.js applications, you will need something more sophisticated than nodemon. The tool we are going to use is PM2, an advanced, production process manager for Node.js (http://pm2.keymetrics.io/). We are going to install it locally for Jenkins and globally for our convenience:
npm install pm2 --save-devnpm install pm2 -g
With PM2, we can start and stop Node.js scripts:
pm2 start index.jspm2 listpm2 stop index.jspm2 delete index.jspm2 kill
In the command user interface we can see that our website is actually running.
In Jenkins, we have a bit of a problem though, we can start up PM2 and run our tests, but when our tests ...