Skip to content

GitLab CI Kotlin DSLopensavvy.gitlab.cijob

job

fun GitLabCi.job(name: String, stage: Stage? = null, block: Job.() -> Unit): ERROR CLASS: Unresolved name: also

Declares a new Job in the current pipeline.

A job is a unit of work in a pipeline: each job is executed by a runner. Jobs can have dependencies, artifacts and more.

Example

gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.task("build")
        }
    }
}.println()

External documentation

Parameters

name

The name of the job. See Job.name. If using the by syntax, the default name is the name of the variable the job is assigned to.

stage

The stage this job is part of. If unset, see the official documentation.

fun GitLabCi.job(name: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): DelegateProvider<GitLabCi, ReadOnlyDelegate<ERROR CLASS: Cannot infer argument for type parameter Type>>

Declares a new Job in the current pipeline.

A job is a unit of work in a pipeline: each job is executed by a runner. Jobs can have dependencies, artifacts and more.

Example

gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.task("build")
        }
    }
}.println()

External documentation

Parameters

name

The name of the job. See Job.name. If using the by syntax, the default name is the name of the variable the job is assigned to.

stage

The stage this job is part of. See Job.stage.