Skip to main content

Command Palette

Search for a command to run...

Day 26 : Jenkins Declarative Pipeline

Updated
2 min read

Introduction: Welcome to my blog post where we'll explore the power and simplicity of the Jenkins Declarative Pipeline by building a classic "Hello World" example. The Declarative Pipeline is a powerful way to define and execute continuous integration and deployment workflows, enabling teams to streamline their software development processes. Let's dive in and get started!

What is the Declarative Pipeline? The Declarative Pipeline is a domain-specific language (DSL) built on top of Jenkins' Pipeline plugin. It provides a structured and concise syntax for defining pipelines as code, making them more readable, maintainable, and versionable. With its declarative nature, you focus on the desired outcome rather than the complex scripting details.

Setting up Jenkins and Creating a New Job: Before we begin, ensure that you have Jenkins installed and configured on your system. Once Jenkins is up and running, create a new job and select the "Pipeline" option.

You don't need to select any other options Just write pipeline below as shown in the Screenshot.

Save it. When you click on "Build Now". You will see Stage view like this.

If you check your console you will see like.

Tha's it. It was the Simple Hello World Declarative pipeline. We can also choose script for pipeline from GitHub repository.

Creating a Jenkinsfile and committing it to source control provides a number of immediate benefits:

  • Automatically creates a Pipeline build process for all branches and pull requests.

  • Code review/iteration on the Pipeline (along with the remaining source code).

I hope this blog helps you to clear doubt about simple declarative pipeline in Jenkins. If you have any questions/suggestions please comment below.

#Jenkins #DeclarativePipeline #CI/CD #DevOps #Automation #SoftwareDevelopment #ContinuousIntegration #ContinuousDeployment #PipelineAsCode #CodeQuality #DevOpsTools #SoftwareDelivery #DevOpsCommunity #HelloWorld #90dayofdevops

More from this blog

Ajay Patel

116 posts