Tech Corner

Understanding the basics of the Jenkins Pipeline

Megha Baweja
.
Sep 8
.
4-5 mins

Table of contents

Automate your business at $5/day with Engati

REQUEST A DEMO
Jenkins Pipeline

Jenkins, the heart of DevOps, is a continuous integration tool that allows developers to integrate code into a shared repository at regular intervals. The usual practice is to trigger a build as soon as the code is committed to the repository.

If you’re worried about Jenkins replacing Hudson, we can assure you that Hudson is still available as a managed project by Oracle. In fact, Jenkins was forked from the Hudson source code and later began to be supported by the open community. 

The common process of Jenkins involves the following 3 steps:

  • Developers make changes to the code and commit it to their repository
  • Jenkins picks up the code and later runs builds and any tests that may be required
  • As a post step, notifications can be triggered, logs can be checked, or any other cleaning job can take place

Any event mapped above, is taken care of by a Jenkins job. A Jenkins job is simply a process that runs on Jenkins server to provide the above mentioned functionality.

If you’re new to Jenkins, we’re going to help you understand the basics of the Jenkins pipeline, along with the functionality aspect of Jenkins. 

What is Jenkins Pipeline?

Jenkins pipeline allows us to define a complete list of events that happen in the code lifecycle. Starting from the build, to testing and deployment. 

We can use a set of plugins that help in the implementation of certain processes as a continuous delivery pipeline. Where pipelines are defined using code by using groovy language to define the processes that would run in the pipeline. 

To implement pipeline as code, a Jenkinsfile needs to be present at the project’s root repository.

Jenkinsfile supports two different syntax:

  • Declarative
  • Scripted

Declarative pipeline was a recent release and provides better syntax support over the scripted pipelines.

Why should you use Jenkins pipeline?

  • Pipeline can be run in a loop.
  • It supports larger projects that may involve a high CPU job, provided the Jenkins infrastructure is scalable enough to support it.
  • Since Jenkins pipeline is written in code, any number of users can use it as a template, modify it and run customized tests and processes.
  • Multiple jobs can be run in parallel.
  • Jenkins Pipeline is robust. Pipeline can automatically be resumed from it might have stopped for any reason.

Understanding the pipeline

  • PipelineA user-defined block, which contains all the processes such as build, test, deploy, etc. All the stages and steps are defined in this block.
  • NodeThe node is a machine on which Jenkins runs. A node block is used in scripted pipeline syntax.
  • StageThis block contains a series of steps in a pipeline. i.e., build, test, deploy processes on a stage.

Let us see an example for multiple stages, where each stage performs a specific task:


Multiple Stages in Jenkins pipeline
Multiple Stages in Jenkins pipeline

  • StepA step is a single task that executes a particular process at a defined time. A pipeline involves steps defined within a stage block.


Single step in jenkins pipeline
Single step in Jenkins pipeline

Defining a Jenkins pipeline

The following steps run smoothly once you have the initial configuration and installations complete for Jenkins.

1

For Jenkins Pipeline, install the Pipeline plugin

Go to Manage Jenkins > Manage Plugins > Available section > Search Pipeline.

If you are already installed Pipeline It will display in the Installed section.

Create a new project with the Pipeline.

2

Go to Jenkins Home > New Item > Create Project with Pipeline

After creating Pipeline Project the following window should appear:

Create project ith Jenkins Pipeline
Create project with Jenkins Pipeline


This is where we write pipeline code.

The two options seen in the image are as follows:

  • Pipeline ScriptWrite the Pipeline directly on Jenkins.
  • Pipeline Script from SCMWrite Jenkinsfile and upload it on any SCM and then use it from that repository.

Conclusion

Training and testing is a crucial aspect of the Software Development Life Cycle. Jenkins Pipeline helps you test your software pipelines without any hassle. And now training has become a part of Engati’s culture, and we extend this to our clients by providing a training module for chatbots to guarantee customer satisfaction. 

Register with Engati to learn more.

3x your revenue with Chatbots and Live Chat
Schedule a demo


Megha Baweja

Close Icon
Request a Demo!
Get started on Engati with the help of a personalised demo.
Thanks for the information.
We will be shortly getting in touch with you.
Oops! something went wrong!
For any query reach out to us on contact@engati.com
Close Icon
Congratulations! Your demo is recorded.

Select an option on how Engati can help you.

I am looking for a conversational AI engagement solution for the web and other channels.

I would like for a conversational AI engagement solution for WhatsApp as the primary channel

I am an e-commerce store with Shopify. I am looking for a conversational AI engagement solution for my business

I am looking to partner with Engati to build conversational AI solutions for other businesses

continue
Finish
Close Icon
You're a step away from building your Al chatbot

How many customers do you expect to engage in a month?

Less Than 2000

2000-5000

More than 5000

Finish
Close Icon
Thanks for the information.

We will be shortly getting in touch with you.

Close Icon

Contact Us

Please fill in your details and we will contact you shortly.

Thanks for the information.
We will be shortly getting in touch with you.
Oops! Looks like there is a problem.
Never mind, drop us a mail at contact@engati.com