GitLab CI Kotlin DSL • opensavvy.gitlab.ci • GitLabCi
GitLabCi¶
class GitLabCi : YamlExport
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:
Once the pipeline is configured as you'd like, call toYaml or println to build the configuration file.
Constructors¶
GitLabCi¶
constructor()
Functions¶
job¶
fun GitLabCi.job(name: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): DelegateProvider<GitLabCi, ReadOnlyDelegate<ERROR CLASS: Cannot infer argument for type parameter Type>>
kanikoBuild¶
fun GitLabCi.kanikoBuild(imageName: String, imageVersion: String = defaultVersion, context: String = ".", dockerfile: String = "/Dockerfile", jobName: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): DelegateProvider<GitLabCi, ReadOnlyDelegate<ERROR CLASS: Cannot infer argument for type parameter Type>>
Creates a job that builds the image imageName with version imageVersion. If the imageName contains a registry name, pushes the image to the registry.
kanikoRename¶
fun GitLabCi.kanikoRename(imageName: String, oldVersion: String = defaultVersion, newVersion: String = "latest", jobName: String? = null, stage: Stage? = null, block: Job.() -> Unit = {}): DelegateProvider<GitLabCi, ReadOnlyDelegate<ERROR CLASS: Cannot infer argument for type parameter Type>>
Creates a job that changes the version of the image imageName from oldVersion to newVersion.
println¶
fun println(): ERROR CLASS: cycle
Generates the Yaml of this pipeline, and prints it to the standard output.
stage¶
Creates a stage with a given name.
fun GitLabCi.stage(name: String? = null): DelegateProvider<GitLabCi, ReadOnlyDelegate<Stage>>
Creates a stage automatically named after the variable it is assigned to.
toYaml¶
open override fun toYaml(): Yaml.Collection.MapLiteral
Converts this object into a Yaml object.