Job
Deprecated
Pipelines DSL is in development and should not be used. Breaking changes are expected.
Represents a job within a TeamCity pipeline.
A job is a unit of work in a pipeline that performs a specific task, such as building, testing, or deploying. Jobs can have dependencies on other jobs, allowing for complex workflows.
The id and name are mandatory properties for a valid job (id can be omitted if it matches the class name).
Job settings are grouped into blocks:
steps() - configures the steps for the job
params() - configures job parameters
outputParam() - defines job output parameters
dependency() - defines job dependencies
filePublication() - configures file publications
repository() - configures repositories for the job
Example. Basic job with build steps
job("build") {
name = "Build Application"
steps {
gradle {
tasks = "clean build"
buildFile = "build.gradle"
}
}
}Example. Job with dependencies and parameters
job("deploy") {
name = "Deploy Application"
params {
param("env.DEPLOY_ENV", "production")
}
steps {
script {
scriptContent = "deploy.sh"
}
}
dependency("build")
dependency("test")
}See also
Constructors
Types
Represents a dependency on another job.
Represents a file publication configuration.
Represents a repository used by the job.
Properties
Allow reuse
Job dependencies
Enable dependency cache optimization
Job file publications
Job integrations
Job output parameters
Job parallelism determines parallelism level for this job
Job parameters
Job repositories
Functions
Adds a dependency on the specified job
Adds a dependency on a job with the specified id.
Adds a dependency on the specified job with a list of files
Adds a dependency on a job with the specified id and a list of files.
Adds a file publication with the specified path.
Adds a file publication with the specified path and options.
Adds the specified integration to the job.
Adds an integration to the job.
Adds an output parameter to the job. Output parameters can be used by other jobs that depend on this job.
Configures output parameters, i.e. the parameters which will be visible to jobs depending on this job.
Configures job parameters
Adds a repository with the specified id
Adds a repository with the specified IdOwner
Configures job steps
Validates the job configuration. Checks that all required properties are set and all components are valid.