Skip to content

GitLab CI Kotlin DSLopensavvy.gitlab.ciArtifactsexpireIn

expireIn

fun expireIn(time: String)

Specifies how long job artifacts are stored before they expire and are deleted.

The expiration time period begins when the artifact is uploaded and stored on GitLab. If no unit is provided, the time is in seconds. Use "never" to prevent expiration.

Example

val build by job {
    script {
        shell("make build")
    }

    artifacts {
        include("binaries/")
        expireIn("1 week")
    }
}

Example: various time formats

artifacts {
    include("logs/")
    expireIn("3 mins 4 sec")  // or "2 hrs 20 min", "6 mos 1 day", etc.
}

External resources