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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Mastering Shift-Left: The Ultimate Guide to Input Validation in Jenkins Pipelines
  • Jenkins Pipelines With Centralized Error Codes and Fail-Fast
  • Optimizing CI/CD Pipeline With Kubernetes, Jenkins, Docker, and Feature Flags
  • Building Jenkins Infrastructure Pipelines

Trending

  • Unlocking the Benefits of a Private API in AWS API Gateway
  • Google Cloud Document AI Basics
  • Unlocking AI Coding Assistants Part 3: Generating Diagrams, Open API Specs, And Test Data
  • Integrating Security as Code: A Necessity for DevSecOps
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Tips to Debug Jenkins v2.x Pipeline Script(s), Part 1

Tips to Debug Jenkins v2.x Pipeline Script(s), Part 1

Check out this simple explanation of these three features that will help you with your Jenkins pipeline.

By 
Ramanathan M user avatar
Ramanathan M
·
Jan. 03, 19 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
33.8K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

In this series of posts, I wish to share (and learn from their feedback) with the community, some of the ways and methods to debug Groovy-DSL scripts used in Jenkins v2.x Pipeline-as-code.

Replay

This feature enables iterative development of the pipeline script. For beginners, it's a great feature as they can try out various possibilities before submitting the working version of the script for peer code review.

Select the build job from the Jenkins project that you wish to replay. devtest-pipeline is the project in this screenshot and we can choose to click the Replay option available for job #362.

Replay


"Show Me Red," a.k.a. Fix the Syntax Errors

On selecting the Replay option, Jenkins opens up a simple in-line editor as shown below.

This screenshot shows the pipeline-as-code script with line 7 marked by a white colored "X" inside the red square box. Such error pointer(s) (it's my lingua franca) are enabled by the Jenkins Pipeline's suite of plugins. For the sake of this example, I induced the error pointer, by removing the closing double quote at the end of the println  statement.

Error pointer

This provision (error pointer) is quite handy when you are in the process of writing such pipeline-as-code Groovy-DSL scripts — either scripted or declarative.

Easy on The Eyes

This is not a technical one but will help to avoid silly mistakes, like, missing quote(s) or typo errors.

With the Replay option making available a simple editor, the default size of that editor can be quite small and compact. However, there is no lock-in with regard to the real estate of the editor, hovering the mouse cursor on the extreme right-hand side bottom of the editor brings up (single or double headed) an arrow that helps you to resize the shape of the editor.

Resize the editor


Jenkins (software) Pipeline (software) Debug (command)

Opinions expressed by DZone contributors are their own.

Related

  • Mastering Shift-Left: The Ultimate Guide to Input Validation in Jenkins Pipelines
  • Jenkins Pipelines With Centralized Error Codes and Fail-Fast
  • Optimizing CI/CD Pipeline With Kubernetes, Jenkins, Docker, and Feature Flags
  • Building Jenkins Infrastructure Pipelines

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!