Jenkins provides a excellent UI, using which a developer can write a CI/CD job.

But what happens if the Jenkins instance goes down? The Jenkins job which is created from the UI will be deleted.

What is the other alternative?

Jenkins provides a way to define the events in the form of code, which we called as Jenkins pipeline.

A pipeline is a collection of events or jobs that might be interlinked together in a sequence.

Jenkins pipeline is usually written in a .jenkins file and placed in a version control system like github.

There are two ways to define a pipeline in Jenkins 1.Scripted pipeline 2.Declarative pipeline

General-purpose DSL built on groovy.Most functionality of groovy is made available.They are very flexible and expressive.

Scripted pipeline

Recently added to the Jenkins pipeline. It follows a very simple syntax on top of the Pipeline sub-systems.

Declarative pipeline