DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Announcing the General Availability of Jenkin's Declarative Pipeline

Announcing the General Availability of Jenkin's Declarative Pipeline

The new Jenkins Pipeline syntax is much more approachable with an easy adoption curve so that you can quickly realize all of the benefits of Pipeline as Code.

Patrick Wolf user avatar by
Patrick Wolf
·
Feb. 05, 17 · News
Like (0)
Save
Tweet
Share
6.69K Views

Join the DZone community and get the full member experience.

Join For Free

I am very excited to announce the addition of Declarative Pipeline syntax 1.0 to Jenkins Pipeline. We think this new syntax will enable everyone involved in DevOps, regardless of expertise, to participate in the Continuous Delivery process. Whether creating, editing, or reviewing a pipeline, having a straightforward structure helps to understand and predict the flow of the pipeline and provides a common foundation across all pipelines.

Pipeline as Code was one of the pillars of the Jenkins 2.0 release and an essential part of implementing continuous delivery. Defining all of the stages of an application’s CD pipeline within a Jenkinsfile and treating it as part of the application code automatically provides all of the benefits inherent in SCM:

  • Retain history of all changes to Pipeline.
  • Rollback to a previous pipeline version.
  • Review new changes to the pipeline in code review.
  • Test new pipeline steps in branches.
  • Audit changes to the pipeline.
  • Run the same pipeline on a different Jenkins server.

We recommend people begin using it for all their pipeline definitions in Jenkins and the CloudBees Jenkins Platform. The plugin has been available for use and testing starting with the 0.1 release that was debuted at Jenkins World in September. It has already been installed over 5,000 times.

If you haven’t tried Pipeline or have considered Pipeline in the past, we believe this new syntax is much more approachable with an easy adoption curve so that you can quickly realize all of the benefits of Pipeline as Code. In addition, the predefined structure of Declarative makes it possible to create and edit pipelines with a graphical user interface (GUI). The Blue Ocean team is actively working on a Pipeline Editor that will be included in an upcoming release.

If you have already begun using Pipelines in Jenkins we believe that this new alternative syntax can help expand that usage. The original syntax for defining pipelines in Jenkins is a Groovy DSL that allows most of the features of full imperative programming. This syntax is still fully supported and is now referred to as “Scripted Pipeline Syntax” to distinguish it from “Declarative Pipeline Syntax.” Both use the same underlying execution engine in Jenkins and both will generate the same results in Pipeline Stage View or Blue Ocean visualization. All existing pipeline steps, global variables and shared libraries can be used in either. You can now create more cookie-cutter pipelines and extend the power of Pipeline to all users regardless of Groovy expertise.

Other key features of Declarative Pipeline include the following.

Syntax Checking  

  • Immediate runtime syntax checking with explicit error messages.
  • API endpoint for linting Jenkinsfiles.
  • CLI command to lint Jenkinsfiles.

Docker Pipeline Plugin Integration

  • Run all stages in a single container.
  • Run each stage in a different container.

Easy Configuration

  • Quickly define parameters for your pipeline.
  • Quickly define environment variables and credentials for your pipeline.
  • Quickly define options (such as timeout, retry, and build discarding) for your pipeline.

Conditional Actions

  • Send notifications or take actions depending upon success or failure.
  • Skip stages based on branches, environment, or other Boolean expressions.

Be on the lookout for future blog posts here or on Jenkins.io detailing specific examples of scenarios or features in Declarative Pipeline. Andrew Bayer, one of the primary engineers behind Declarative Pipeline, will be presenting at FOSDEM in Brussels, Belgium this weekend. We have also scheduled an online Jenkins Area Meetup (JAM) later this month to demo the features of Declarative Pipeline and give a sneak peek at the upcoming Blue Ocean Pipeline Editor.

In the meantime, we have updated all Pipeline documentation to incorporate a Getting Started guide, a Guided Tour, and a Syntax Reference page with numerous examples to help you get on your way. We have also created a that can be printed and hung nearby. 

Pipeline (software) Jenkins (software)

Published at DZone with permission of Patrick Wolf. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • TDD: From Katas to Production Code
  • Automated Performance Testing With ArgoCD and Iter8
  • Continuous Development: Building the Thing Right, to Build the Right Thing
  • Apache Kafka Introduction, Installation, and Implementation Using .NET Core 6

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: