Skip to content

GitLab CI Kotlin DSLopensavvy.gitlab.ciJobscript

script

fun script(block: CommandDsl.() -> Unit)

Adds commands to execute in this job.

Example

val test by job {
    script {
        shell("echo Hello World")
    }

    script {
        shell("echo You can call 'script' multiple times")
        shell("echo or add multiple commands inside a single 'script' call")
    }
}

Calling script multiple times executes the commands after the previous ones (the execution happens in the same order as in the source code).

See CommandDsl to see what functions are available in script.

External resources