Jenkins Pipeline

Different ways to define a jenkins pipeline

Jenkins is the most popular CI/CD tool, while is completely open-source.

Jenkins provides a excellent, 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

Scripted pipeline

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

Declarative pipeline

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