Simple test project for learning cicd with a nodejs app, github, and jenkins using DigitalOcean.
I have some configurations differently than in the tutorial. Notably, my package.json and my jenkins build step.
// inside package.json
"scripts": {
"test": "mocha --exit"
},This enables me to test the project with npm test. Secondly, my jenkins build step:
rm -rf node_modules
npm install
npm t
ssh <user>@<NODE.SERVER.IP> <<EOF
cd ~/cicd-test
git pull
rm -rf node_modules
npm install -production
pm2 restart all
exit
EOF- Medium Tutorial: covers entire setup process.
- Digital Ocean Tutorial: on configuring a jenkins droplet, for which the above tutorial is out-of-date.