Pipeline as Code (PAC)
- Pipeline as a code allows us to define CI/CD in a text document in any version control system
- CI/CD Pipeline when expressed as PAC will be present in git.
- Jenkins has started supporting Pipelines with
- Scripted Pipelines
- Declartive Pipelines
Scripted Pipelines
- A pipeline can be defined in any file but
Jenkinsfile
is most widely used name. - The structure of Pipeline in scripted is as shown below
- Jenkins will have a set of steps which will be part of default jenkins installation and rest of steps can be added to jenkins by installing plugins
- Jenkins Pipeline steps reference Refer Here
- Lets build a scripted pipeline for game of life
- Step: Clone the code using git pipeline Refer Here
- Refer Here for changes
- Create a new job and select pipleline from scm
- Build the pipeline and you should be able to see the stage wise logs.
- Refer Here for the next set of changes.
- Build the project and view the project post refresh after success