Cicd Session 1
Cicd Session 1
Cicd Session 1
Session 6
By Praveen Singampalli
By Praveen Singampalli
11th June 2022(4-6 PM)
1)Why CICD and
E2E Flow
RoadMap
discussion:
5) WebHook 3) What tools
Trigger are needed
4) Auto Version
implementation
in Github
Different types of
Jenkins Pipeline
• Declarative Pipeline Syntax
The declarative syntax is a new feature
that uses code for the pipeline. It
provides a limited pre-defined
structure. Thereby, it offers an easy &
simple continuous delivery pipeline.
Moreover, it uses a pipeline block.
• Scripted Pipeline Syntax
Unlike declarative syntax, the scripted
pipeline syntax is the old traditional way
to write the Jenkinsfile on Jenkins web
UI. Moreover, it strictly follows the
groovy syntax and helps to develop a
complex pipeline as code.
Scripted Pipeline Declarative Pipeline(Jenkinsfile
add to git repo )
JenkinsFile Data
Key concepts of Jenkinsfile
• Pipeline - A pipeline is a set of instructions that includes the processes of continuous delivery. For example, creating an application,
testing it, and deploying the same. Moreover, it is a critical element in declarative pipeline syntax, which is a collection of all stages in
a Jenkinsfile. We declare different stages and steps in this block.
• pipeline{ } Node - A node is a key element in scripted pipeline syntax. Moreover, it acts as a machine in Jenkins that executes the
Pipeline.
• node{ } Stage - A stage consists of a set of processes that the Pipeline executes. Additionally, the tasks are divided in each stage,
implying that there can be multiple stages within a Pipeline. The below snippet shows the different stages that one can define in a
Pipeline.
• Steps - A step in Jenkins defines what we have to do at a particular step in the process. There can be a series of steps within the stage.
Moreover, whatever step we define in a stage would be executed within it.
• Agent - An agent is a directive that enables the users to execute multiple projects within the same Jenkins instance by distributing the
load. Moreover, we assign an executor to the build through an agent. You can either use a single agent for the entire pipeline or use a
distinct agent for the different stages of the pipeline. Subsequently, some of the parameters used with agents are -
• Any- Any of the available agents execute the pipeline.
• None- It is used at the pipeline root and implies no global agent, but each stage must specify its own agent.
• Label- The labeled agent is used to execute the pipeline or the specific stage.
• Docker- One can use the Docker images as the execution environment & specifying the agent as docker.
Child Pipeline -
from dev to
master Master Pipeline -
3
4
5
Trigger a pipeline from JenkinsFile
GitLab Branching
Strategy
• Master Branch – This branch mainly deals
with the prod deployment(Prod Pipeline)
• Hotfix Branch – This branch deals with any
issues related to prod fixes (Bug/Feedback
from customer)(Hotfix Pipeline)
• Release Branch (Release Pipeline) – The
code from this branch is deployed in
higher environments(QA/STAGE) except
prod
• Develop Branch (Dev Pipeline)– Called as
Dev branch and it deals with the changes
done by developers for their own branch
• Feature Branch – Deals with the new
features taken up for the sprint(We usually
use to merge the feature to release branch
and then deploy)
THANK YOU ALL
Follow me on Instagram/LinkedIn