Contains Directives or Steps
agent- where env will executepost- run once Pipeline or stage has run. Supports blocksalways(regardless),changed(different completion status),failure,success,unstable(Pipeline or stage run status == "unstable" e.g. test failures),abortedstages/steps- sequence ofstagedirectives e.g.stage('Deploy staging') { steps { ... } }
environment- env varsoptions- config Pipeline (or Stage)params- params called with trigger, available viaparamsobjecttriggers- automated ways Pipeline started e.g. webhook, CRONtools- binaries to install & +PATHinput- prompt userwhen- condition for stage executionstage
Nested stages executed in parallel
script- use a special DSL
stage('Test') {
steps {
sh './genCustomReports.html'
sh './genJUnitReports.html'
}
}
}
post {
always {
archiveArtifacts artifacts: 'build/reports/**/customReport-*.html', fingerprint: true
junit 'build/reports/junit/**/*.xml'
}
}