GitLab CI Kotlin DSL • opensavvy.gitlab.ci • Job
Job¶
class Job : YamlExport
A single execution step in a pipeline
.
Jobs are instantiated using the job
factory. See its documentation for more information.
Properties¶
name
¶
The name of this job, as it appears in the GitLab UI.
stage
¶
The Stage
this job is a part of.
Functions¶
afterScript
¶
fun afterScript(block: CommandDsl.() -> Unit)
Adds commands to execute after the main script of this job.
artifacts
¶
Declares paths that will be saved at the end of the job, and can later be consumed by other jobs in the same pipeline.
beforeScript
¶
fun beforeScript(block: CommandDsl.() -> Unit)
Adds commands to execute before the main script of this job.
cache
¶
Declares paths that will be reused between different jobs, even if they are of different pipelines.
coverage
¶
Declares a regular expression
to configure how code coverage is extracted from the job output. The coverage is shown in the UI if at least one line of the job output matches regex
.
dependsOn
¶
This job will wait until job
has terminated.
image
¶
fun image(name: String, version: String = "latest", configuration: ContainerImage.() -> Unit = {})
The container image used to execute this job.
interruptible
¶
fun interruptible(bool: Boolean)
Determines whether this job can be safely canceled after it has started.
publishChangelogToDiscord
¶
fun Job.publishChangelogToDiscord()
publishChangelogToTelegram
¶
retry
¶
Configures how many times a job is retried if it fails. If not defined, defaults to 0 and jobs do not retry.
script
¶
fun script(block: CommandDsl.() -> Unit)
Adds commands to execute in this job.
service
¶
fun service(name: String, version: String = "latest", configuration: ContainerService.() -> Unit = {})
Additional container images used by this job.
tag
¶
Adds a tag to this job.
toYaml
¶
Converts this object into a Yaml object.
useContainerRegistry
¶
fun Job.useContainerRegistry()
Logs in the current job to the GitLab Container Registry.
useDockerInDocker
¶
fun Job.useDockerInDocker(dockerVersion: String = "20.10", dockerInDockerVersion: String = "-dind")
Configures the current job to use the docker
command using Docker In Docker.
useGradle
¶
Enables the Gradle
plugin.
variable
¶
Declares an environment variable that will be available for the entire length of the job.