Jenkins · Steps and credentials

Retry and time-limit a step

Retry a flaky step and give up if it takes too long.

retry(3) {
  timeout(time: 5, unit: 'MINUTES') {
    sh './flaky-integration-test.sh'
  }
}

Official Jenkins documentation

More steps and credentials commands

All steps and credentials commands · Jenkins cheatsheet

Was this page helpful?