Sample project made to apply some of my knowledge on the Automation topic.
- Simple Express API that has one endpoint.
- A test case made with Mocha & Chai.
- Dockerfile to containerize the app with Docker.
- Jenkinsfile pipline that performs the following steps:
- Clones this repo.
- builds then runs the test cases.
- Builds the Docker image.
- Pushes the image to a private repo on Docker Hub registry.
- Jenkins instance with the following plugins:
- NodeJS Jenkins Plugin
(install then follow the config instructions) - Docker Pipeline Plugin
- NodeJS Jenkins Plugin
- Private Docker Hub repository
(changeregistry
variable inside Jenkinsfile) - Jenkins credentials entry with the ID:
docker-cred
- New Jenkins pipeline job that pulls definition from git scm.