Skip to content

Retry

class Retry : YamlExport

Configuration for job retry behavior.

Example

val test by job {
    retry(3) {
        whenType(RetryWhen.Always)
        onExitCode(127)
    }
}

External resources

Properties

max

val max: Int

The maximum number of times a job is retried if it fails. Supported values: 0, 1, or 2.

Functions

on

fun on(type: RetryCause)

Specifies which failure types to retry on.

Example
retry(2) {
    whenType(RetryWhen.RunnerSystemFailure)
}
External resources

onExitCode

fun onExitCode(code: Int)

Specifies which exit codes to retry on.

Example
retry(2) {
    onExitCode(137)
}
External resources

toYaml

open override fun toYaml(): Yaml

Converts this object into a Yaml object.