#90DaysOfDevOps
One of the most important parts of your DevOps and CICD journey is a Declarative Pipeline Syntax of Jenkins
What is a Pipeline - A pipeline is a collection of steps or jobs interlinked in a sequence.
Declarative: Declarative is a more recent and advanced implementation of a pipeline as a code.
Scripted: Scripted was the first and most traditional implementation of the pipeline as a code in Jenkins.
It was designed as a general-purpose DSL (Domain Specific Language) built with Groovy.
Pipeline syntax
pipeline {
agent any
stages {
stage('Build') {
steps {
//
}
}
stage('Test') {
steps {
//
}
}
stage('Deploy') {
steps {
//
}
}
}
}
Task-01
Create a New Job, this time select Pipeline instead of Freestyle Project.
Follow the Official Jenkins Hello World example
Complete the example using the Declarative pipeline
-Description of file
-Pipeline Script
-Console Output
- Stage view status
-This is Simple Pipeline that prints out "Hello World"
Writing a Declarative Pipeline in Jenkins.
script pipeline
pipeline project status
-Console output