Pipeline
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 pipeline method.
The id and name are mandatory properties for a valid pipeline (id can be omitted if it matches the class name).
Pipeline settings are grouped into blocks:
job() - defines a job within the pipeline
repositories() - configures VCS repositories for the pipeline
triggers() - configures pipeline triggers
integrations() - configures pipeline integrations
params() - configures pipeline parameters
Example. Pipeline defined as an object with jobs
object DeployPipeline: Pipeline({
id("DeployPipeline")
name = "Deploy Pipeline"
repositories {
main(DslContext.settingsRoot)
}
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"
triggers {
vcs {
branchFilter = "+:*"
}
}
job("build") {
name = "Build"
steps {
// job steps
}
}
}See also
Constructors
Properties
Pipeline jobs
Pipeline output parameters exposed to downstream pipelines and build configurations.
Pipeline parameters
Pipeline repositories
Functions
Configures dependencies
Configures pipeline integrations.
Configures pipeline output parameters. Output parameters are exposed to downstream pipelines and build configurations via %dep.PipelineId.paramName% syntax.
Configures pipeline parameters
Configures VCS repositories for the pipeline. Allows setting a main repository and adding additional repositories.
Configures pipeline triggers.
Validates the pipeline configuration. Checks that all required properties are set and all components are valid.