Skip to content

Developing Jenkins Pipelines

Hands-on development and testing of Jenkins Pipelines and shared libraries.

Tags: jenkins pipeline testing ci-cd

Slides

Abstract

Developing a Jenkins Pipeline should not mean pushing every change to a shared server and waiting for a build to find the next mistake. In this hands-on workshop, we explore developer tools and practices for writing, reviewing, and testing Pipelines with a faster feedback loop.

Participants work with Jenkinsfiles and shared Pipeline libraries, extract reusable automation, and explore ways to validate and test changes locally. We compare testing approaches, from unit testing Pipeline code and mocking Jenkins steps to integration testing against a containerized Jenkins instance with Testcontainers. Along the way, we discuss maintainability, versioning, and common pitfalls when sharing Pipeline code across projects.

Workshop chapters#

  1. Pipeline fundamentals and practices: Develop Jenkinsfiles and discuss readability, maintainability, and common pitfalls.
  2. Pipeline developer tools: Use local editing and validation workflows to shorten the feedback loop before committing changes.
  3. Shared Pipeline libraries: Managing Jenkins pipelines at scale.
    • Extract reusable automation, organize and version libraries, and use them across projects.
  4. Unit testing: Explore testing frameworks for Pipeline code, including mocking Jenkins steps and testing shared library behavior.
  5. Integration testing: Run and test Pipelines against a containerized Jenkins instance using Testcontainers, and compare integration and unit tests.

References