jobs.job definition
A job is a collection of steps run by an agent or on a server.
jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
displayName: string # Human-readable name for the job.
dependsOn: string | [ string ] # Any jobs which must complete before this one
condition: string # Evaluate this condition expression to determine whether to run this job.
continueOnError: string # Continue running even on failure?.
timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
variables: variables # Job-specific variables
strategy: jobStrategy # Execution strategy for this job
pool: pool # Pool where this job will run
services: # Container resources to run as a service container.
string: string # Name/value pairs.
workspace: # Workspace options on the agent.
clean: string # Scorch the repo before fetching?. (outputs, resources, all)
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template | restoreCache | saveCache ]
Properties that use this definition: jobs
Properties
job
string
Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.displayName
string
Human-readable name for the job.dependsOn
string or string list
Any jobs which must complete before this one.condition
string
Evaluate this condition expression to determine whether to run this job.continueOnError
boolean
Continue running even on failure?timeoutInMinutes
string
Time to wait for this job to complete before the server kills it.cancelTimeoutInMinutes
string
Time to wait for the job to cancel before forcibly terminating it.variables
strategy
pool
services
string name/value pairs
Container resources to run as a service container.workspace
workspace options
Workspace options on the agent.steps
jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
displayName: string # Human-readable name for the job.
dependsOn: string | [ string ] # Any jobs which must complete before this one
condition: string # Evaluate this condition expression to determine whether to run this job.
continueOnError: string # Continue running even on failure?.
timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
variables: variables # Job-specific variables
strategy: jobStrategy # Execution strategy for this job
pool: pool # Pool where this job will run
container: jobContainer # Container resource name
services: # Container resources to run as a service container.
string: string # Name/value pairs.
workspace: # Workspace options on the agent.
clean: string # Scorch the repo before fetching?. (outputs, resources, all)
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template | restoreCache | saveCache ]
Properties that use this definition: jobs
Properties
job
string
Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.displayName
string
Human-readable name for the job.dependsOn
string or string list
Any jobs which must complete before this one.condition
string
Evaluate this condition expression to determine whether to run this job.continueOnError
boolean
Continue running even on failure?timeoutInMinutes
string
Time to wait for this job to complete before the server kills it.cancelTimeoutInMinutes
string
Time to wait for the job to cancel before forcibly terminating it.variables
strategy
pool
container
services
string name/value pairs
Container resources to run as a service container.workspace
workspace options
Workspace options on the agent.steps
jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
displayName: string # Human-readable name for the job.
dependsOn: string | [ string ] # Any jobs which must complete before this one
condition: string # Evaluate this condition expression to determine whether to run this job.
continueOnError: string # Continue running even on failure?.
timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
variables: variables # Job-specific variables
strategy: jobStrategy # Execution strategy for this job
pool: pool # Pool where this job will run
container: jobContainer # Container resource name
services: # Container resources to run as a service container.
string: string # Name/value pairs.
workspace: # Workspace options on the agent.
clean: string # Which parts of the workspace should be scorched before fetching. (outputs, resources, all)
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]
Properties that use this definition: jobs
Properties
job
string
Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.displayName
string
Human-readable name for the job.dependsOn
string or string list
Any jobs which must complete before this one.condition
string
Evaluate this condition expression to determine whether to run this job.continueOnError
boolean
Continue running even on failure?timeoutInMinutes
string
Time to wait for this job to complete before the server kills it.cancelTimeoutInMinutes
string
Time to wait for the job to cancel before forcibly terminating it.variables
strategy
pool
container
services
string name/value pairs
Container resources to run as a service container.workspace
workspace options
Workspace options on the agent.steps
jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
displayName: string # Human-readable name for the job.
dependsOn: string | [ string ] # Any jobs which must complete before this one
condition: string # Evaluate this condition expression to determine whether to run this job.
continueOnError: string # Continue running even on failure?.
timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
variables: variables # Job-specific variables
strategy: jobStrategy # Execution strategy for this job
pool: pool # Pool where this job will run
container: jobContainer # Container resource name
services: # Container resources to run as a service container.
string: string # Name/value pairs.
workspace: # Workspace options on the agent.
clean: string # Which parts of the workspace should be scorched before fetching. (outputs, resources, all)
uses: # Any resources required by this job that are not already referenced
repositories: [ string ] # Repository references
pools: [ string ] # Pool references
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]
Properties that use this definition: jobs
Properties
job
string
Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.displayName
string
Human-readable name for the job.dependsOn
string or string list
Any jobs which must complete before this one.condition
string
Evaluate this condition expression to determine whether to run this job.continueOnError
boolean
Continue running even on failure?timeoutInMinutes
string
Time to wait for this job to complete before the server kills it.cancelTimeoutInMinutes
string
Time to wait for the job to cancel before forcibly terminating it.variables
strategy
pool
container
services
string name/value pairs
Container resources to run as a service container.workspace
workspace options
Workspace options on the agent.uses
pools and repositories
Any resources required by this job that are not already referenced.steps
jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
displayName: string # Human-readable name for the job.
dependsOn: string | [ string ] # Any jobs which must complete before this one
condition: string # Evaluate this condition expression to determine whether to run this job.
continueOnError: string # Continue running even on failure?.
timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
variables: variables # Job-specific variables
strategy: jobStrategy # Execution strategy for this job
pool: pool # Pool where this job will run
container: jobContainer # Container resource name
services: # Container resources to run as a service container.
string: string # Name/value pairs.
workspace: # Workspace options on the agent.
clean: string # Which parts of the workspace should be scorched before fetching. (outputs, resources, all)
uses: # Any resources required by this job that are not already referenced
repositories: [ string ] # Repository references
pools: [ string ] # Pool references
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]
templateContext: # Job related information passed from a pipeline when extending a template. See remarks for more information.
Properties that use this definition: jobs
Properties
job
string
Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.displayName
string
Human-readable name for the job.dependsOn
string or string list
Any jobs which must complete before this one.condition
string
Evaluate this condition expression to determine whether to run this job.continueOnError
boolean
Continue running even on failure?timeoutInMinutes
string
Time to wait for this job to complete before the server kills it.cancelTimeoutInMinutes
string
Time to wait for the job to cancel before forcibly terminating it.variables
strategy
pool
container
services
string name/value pairs
Container resources to run as a service container.workspace
workspace options
Workspace options on the agent.uses
pools and repositories
Any resources required by this job that are not already referenced.steps
templateContext
templateContext
Job related information passed from a pipeline when extending a template. See remarks for more information.Remarks
Jobs can run conditionally and might depend on earlier jobs.
Note
If you have only one stage and one job, you can use single-job syntax as a shorter way to describe the steps to run.
For more information about templateContext
, see Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates - Use templateContext to pass properties to templates.
Examples
jobs:
- job: MyJob
displayName: My First Job
continueOnError: true
workspace:
clean: outputs
steps:
- script: echo My first job
See also
- For more information about
uses
, see Limit job authorization scope to referenced Azure DevOps repositories. For more information about workspaces, including clean options, see the workspace topic in Jobs. - Learn more about variables, steps, pools, and server jobs.
Comentários
Submeter e ver comentários