A Jenkinsfile is a text file that describes your entire delivery pipeline as code. Build, test, scan, deploy: every step lives in the file, versioned alongside the application it ships. When a deploy fails at 2 a.m., nobody has to remember which buttons someone clicked in a web interface six months ago. The pipeline is in the repository, it is readable, and it can be reviewed like any other code.
This guide teaches the declarative Pipeline syntax, which is the structured, opinionated way to write a Jenkinsfile. Jenkins also offers scripted Pipeline, a more flexible Groovy-based syntax, but declarative is the right default for almost every team: it is easier to read, easier to validate, and Jenkins can check its syntax before the pipeline runs. Everything here is tested against Jenkins LTS 2.580.3, released on 25 November 2026, which requires Java 21 or 25 to run the controller.…