Skip to content

GitLab CI Kotlin DSLopensavvy.gitlab.ciJobdependsOn

dependsOn

fun dependsOn(job: Job, artifacts: Boolean = false, optional: Boolean = false)

This job will wait until job has terminated.

By default, jobs start immediately.

Example

gitlabCi {
    val compile by job {
        script {
            shell("make")
        }

        artifacts {
            include("output")
        }
    }

    val test by job {
        dependsOn(compile, artifacts = true)

        script {
            shell("make test")
        }
    }
}.println()

Official documentation

Parameters

artifacts

If set to true, the artifacts generated by job will be downloaded before the current job starts.

optional

If set to true, the job will run even if job was excluded from this pipeline (using rules, only or when).