Back to Cheat SheetsCI/CD · Intermediate

Jenkins cheat sheet

Declarative pipeline structure, parameters, parallel stages and artifacts.

Pipeline skeleton

Declarative

pipeline {
 agent any
 stages { stage('Test') { steps { sh 'mvn test' } } }
}

Parameters

parameters { choice(name:'ENV', choices:['qa','stage']) }

Env vars

environment { BASE_URL = "https://qa.example.com" }

Execution

Parallel

parallel { stage('chrome'){...} stage('firefox'){...} }

Post actions

post { always { junit '**/surefire-reports/*.xml' } }

Artifacts

archiveArtifacts artifacts: 'report/**', fingerprint: true

Schedule

triggers { cron('H 2 * * *') }

Go beyond the reference

Book a free demo class and apply these commands on live project work.