prmichaelsen / cicd-test

test of cicd pipeline for a node app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cicd-test

Simple test project for learning cicd with a nodejs app, github, and jenkins using DigitalOcean.

Notes

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

Resources

About

test of cicd pipeline for a node app


Languages

Language:JavaScript 100.0%