Docs

Jenkins

A Jenkinsfile describes a declarative pipeline.

Skeleton

pipeline { ... }
Top-level block
agent any
Run on any agent
stages { stage("Build") { ... } }
Define stages
steps { sh "make" }
Shell steps
environment { KEY = "v" }
Env vars

Post & control

post { always { ... } }
Run after stages
when { branch "main" }
Conditional stage
parallel { ... }
Run stages in parallel
input "Deploy?"
Manual gate

Credentials

withCredentials([...]) { }
Inject secrets
credentials("id")
Reference a credential
archiveArtifacts "dist/**"
Save build output