Day 23 Task: Jenkins Declarative Pipelines for Devops Engineers.
Team in the today's session(article), we will learn the Declarative Pipeline in Jenkins with Definitions help of tasks.
Some Common terms for your Knowledge:
A) Pipeline:- A Pipeline is a collection of steps or jobs interlinked in a Sequence.
B) Declarative:- It is a more recent and advanced implementation of a pipeline as a code.he
C) Scripted:- It wast the first and most traditional implementation of the pipeline as a code in Jenkins.
Why you should have a Pipeline:-
The Definition of a Jenkins is written into a text file. which will be written in the code.
Jenkins Pipeline Syntax:-
Discuss with the help of a Task:
Task-01
A) Create a Declarative pipeline in Jenkins, go to jenkins UI and click on New item.
B) Enter the pipeline name & select Pipeline,and the click on ok.
C) After create the pipeline, Now go to project configuration page, In general give a description of your project (I will add This is a Jenkins Pipeline Hello world).
D) Noe to to the 3rd option Pipeline (Definition option) scroll down select the pipeline script.
E) Write a Pipeline Script of "Hello world"
Before i will move for the Build the Pipeline, Let's discuss a small Description of every points which are used for the Script.
Recommended by LinkedIn
1) Pipeline:- Declarative pipeline should start with the pipeline and this is the mandatory block.
2) Agent:- It specifies the jenkins build job should run. we have used the agent as any.
3) Stages:- It consists of the different executable stage block.
Steps:-
Steps block consist of the actual operation which needs to be performed inside Jenkins. in the Diagram i will use the "Hello World"
F) Build the project, you can manually build the project by clicking on the "Build now". link in the project's main page dashboard.
G) After a build a completed, you can view the console output by clicking on the "Console output" in the build page.
H) Now your pipeline are Successfully and Printed the "hello World"
I) you can see the each stage view by Clicking on the "Full stage View" in the project main page.
Now in the today, I have Successfully run the Declarative Pipeline inJenkins.
Thank you for reading this Article !! Stay Connected!!
Happy Learning!!
Next Topic
Day 24 Task: Jenkins Agent for DevOps Engineers.
Hello Maninder... We post 100's of job opportunities for developers daily here. Candidates can talk to HRs directly. Feel free to share it with your network. Visit this link - https://jobs.hulkhire.com And start applying.. Will be happy to address your concerns, if any