Jenkins · Declarative pipeline basics

Set pipeline options

Add a timeout, keep fewer builds and stop on the first failure.

options {
  timeout(time: 30, unit: 'MINUTES')
  buildDiscarder(logRotator(numToKeepStr: '20'))
  disableConcurrentBuilds()
}

Official Jenkins documentation

More declarative pipeline basics commands

All declarative pipeline basics commands · Jenkins cheatsheet

Was this page helpful?