Freestyle vs Pipeline jobs

Why pipeline-as-code wins.

Beginner10 min · lesson 4 of 15

Jenkins has two main ways to define what a job does. Freestyle projects are configured entirely through the web UI — you click to add build steps, check boxes, fill fields. Pipeline jobs are defined by a script (a Jenkinsfile) written in a Groovy-based DSL. Freestyle is where many people start; Pipeline is where every serious project ends up.

Freestyle vs Pipeline
Freestyle (UI-configured)
click to configure
fast to start
lives in Jenkins only
not in your repo
no version history
hard to review or diff
Pipeline (as code)
a Jenkinsfile
in the repository
versioned + reviewed
changes go through PRs
reproducible
rebuild the job from the file
Pipeline-as-code is the modern default: the build definition lives with the code, is reviewed like code, and survives a Jenkins rebuild.

Why pipeline-as-code wins

A freestyle job’s configuration lives only inside Jenkins — it is invisible to your version control, cannot be code-reviewed, and vanishes if the instance is lost. A Jenkinsfile lives in the repository next to the code it builds, so every change to the pipeline goes through the same pull-request review as the app, you can see who changed what and when, and the job can be rebuilt from scratch on any Jenkins. That auditability is also a security property: pipeline changes are reviewable, not silent UI edits.

The idiomatic setup is a Multibranch Pipeline: point Jenkins at a repository, and it automatically discovers every branch (and pull request) that contains a Jenkinsfile and creates a job for it. New branch, new pipeline, no clicking — and it disappears when the branch is merged or deleted.

terminal
# a Multibranch Pipeline job scans the repo and builds any branch with a Jenkinsfile
# New Item → Multibranch Pipeline → point at the repo → Jenkins finds branches + PRs
# the pipeline definition is the repo’s Jenkinsfile, reviewed like any other code
Freestyle jobs drift and hide
A cluster of freestyle jobs, each hand-configured in the UI, becomes unauditable and unreproducible — nobody knows why a setting is there, and a lost controller loses all of it. Prefer Pipeline jobs with a Jenkinsfile in the repo; it keeps your build definition versioned, reviewable, and recoverable.