Jenkinsfile
Introduction
The Jenkinsfile is a file that Jenkins reads to decide on what stages to activate
Purpose
The purpose of this file is to be able to force a Jenkins CI/CD on a specific app project by devops or developers. It comprises of followig stages \n Checkout, Prepare, Lint, UnitTest, Build, Docker, Deployment.
Core parts to setup using groovy language.
###Checkout
This stage setup git modules and checkout code merge is possible for feature & master branch
###Prepare
This stage setup the base modules needed by respective projects for subsequent stages.
###Lint && UnitTest
These Stages runs linting and unit test check against config made in the projects.eg files: jest.config.js, .eslintrc.json
###Build & Docker
These stages build the apps and create docker images for affected applications and publish those images to artefactory store. '''here PS docker registry been used'''
###Deployment
This stage leverage the k8 config in each apps to deploy app to infra configured in those files. i.e: ingress,service, deployment yaml.
Note
By leveraging nx framework we are able to make pipeline optimised in easier way to run affected apps. eg: '''yarn nx affected:apps --all'''