How to do it...

Our build pipeline is going to consist of the following steps:

  • Pull the latest code
  • Run a build step (npm install)
  • Run a test step (npm test)
  • Build an updated container, updating the version number
  • Push the container to DockerHub
  • Roll out the new container to our Minikube environment

This build pipeline will be controlled and executed by Jenkins. Our pipeline will focus only on building the adderservice project. The build process relies on being able to pull the latest code from GitHub. So the first thing we need to do is initialize the micro folder as a local Git repository:

$ cd micro$ git init

To keep the repository clean, let's add a .gitignore file at the root containing the following:

.DS_Store *.log node_modules

Get Node Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.