Pipeline
Deprecated
Pipelines DSL is in development and should not be used. Breaking changes are expected.
Represents TeamCity pipeline, which is a collection of jobs that can be executed in a specific order.
To appear in UI a pipeline should be registered in a project using the jetbrains.buildServer.configs.kotlin.Project.pipeline method.
The id and name are mandatory properties for a valid pipeline (id can be omitted if it matches the class name). The mainVcsRoot is also required for a pipeline to be valid.
Pipeline settings are grouped into blocks:
job() - defines a job within the pipeline
triggers() - configures pipeline triggers
integrations() - configures pipeline integrations
notifications() - configures pipeline notifications
params() - configures pipeline parameters
Example. Pipeline defined as an object with jobs
object DeployPipeline: Pipeline({
id("DeployPipeline")
name = "Deploy Pipeline"
job("build") {
name = "Build Application"
steps {
gradle {
tasks = "clean build"
}
}
}
job("test") {
name = "Run Tests"
steps {
gradle {
tasks = "test"
}
}
dependency("build")
}
job("deploy") {
name = "Deploy Application"
steps {
script {
scriptContent = "deploy.sh"
}
}
dependency("test")
}
})Example. Pipeline with VCS root and triggers
pipeline {
id("CIPipeline")
name = "CI Pipeline"
val vcsRoot = GitVcsRoot({
name = "Main Repository"
url = "https://github.com/example/repo.git"
branch = "refs/heads/main"
})
mainVcsRoot = PipelineOwnVcsRoot(vcsRoot)
triggers {
vcs {
branchFilter = "+:*"
}
}
job("build") {
name = "Build"
steps {
// job steps
}
}
}See also
Constructors
Types
Properties
Additional VCS roots for the pipeline.
Pipeline jobs
Main VCS root for the pipeline. This is a required property. Can be set using either PipelineOwnVcsRoot or PipelineExternalVcsRoot.
Pipeline parameters
Functions
Adds an additional VCS root to the pipeline.
Adds a new additional VCS root initialized with the specified block.
Configures pipeline integrations.
Configures pipeline notifications.
Configures pipeline parameters
Configures pipeline triggers.
Validates the pipeline configuration. Checks that all required properties are set and all components are valid.