Job
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
dependency() - defines job dependencies
outputFiles() - configures output files (share with jobs or publish as artifacts)
repositories() - configures VCS repositories for the job
Example. Basic job with build steps
job {
id("build")
name = "Build Application"
steps {
gradle {
tasks = "clean build"
buildFile = "build.gradle"
}
}
}Example. Job with dependencies and parameters
job {
id("build")
name = "Deploy Application"
params {
param("env.DEPLOY_ENV", "production")
}
steps {
script {
scriptContent = "deploy.sh"
}
}
dependency("build")
dependency("test")
}See also
Constructors
Properties
Allow reuse
Job dependencies
Job integrations
External job artifacts, artifact dependencies on build configurations outside this pipeline
Job output files configuration
Job parallelism determines parallelism level for this job
Job parameters
Job repositories
Job agent requirements
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 an artifact dependency for the specified job. It allows depending on artifact files produced outside the Pipeline the job belongs to.
Configures job features
Adds the specified integration to the job.
Adds an integration to the job.
Configures output files for the job. Allows specifying files to share with other jobs or publish as pipeline artifacts.
Configures job parameters
Configures VCS repositories for the job. Allows adding and configuring repositories specific to this job.
Configures agent requirements
Configures job steps
Validates the job configuration. Checks that all required properties are set and all components are valid.