GitLabCi

Entrypoint to the GitLab CI pipeline generation.

A pipeline is split into multiple stages, each split into multiple jobs.

To create a pipeline, use the factory function:

val pipeline = gitlabCi {
// Declare the different stages
// Declare the different jobs
}

Once the pipeline is configured as you'd like, call toYaml or println to build the configuration file.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun GitLabCi.job(name: String, stage: Stage? = null, block: Job.() -> Unit): <Error class: unknown class>
fun GitLabCi.job(name: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): <Error class: unknown class>

Declares a new Job in the current pipeline.

Link copied to clipboard
fun GitLabCi.kanikoBuild(imageName: String, imageVersion: String = defaultVersion, context: String = ".", dockerfile: String = "/Dockerfile", jobName: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): <Error class: unknown class>

Creates a job that builds the image imageName with version imageVersion. If the imageName contains a registry name, pushes the image to the registry.

Link copied to clipboard
fun GitLabCi.kanikoRename(imageName: String, newImageName: String = imageName, oldVersion: String = defaultVersion, newVersion: String = "latest", jobName: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): <Error class: unknown class>

Creates a job that renames the image imageName to newImageName and changes its version from oldVersion to newVersion.

Link copied to clipboard
fun println(): <Error class: unknown class>

Generates the Yaml of this pipeline, and prints it to the standard output.

Link copied to clipboard

Creates a stage with a given name.

Creates a stage automatically named after the variable it is assigned to.

Link copied to clipboard
open override fun toYaml(): Yaml.Collection.MapLiteral

Converts this object into a Yaml object.