Определение jobs.job

Задание — это коллекция шагов, выполняемых агентом или на сервере.

jobs:
- job: string # Required as first property. ID of the job.
  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 | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # 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.
  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 | reviewApp ] # A list of steps to run.
  templateContext: # Job related information passed from a pipeline when extending a template.
jobs:
- job: string # Required as first property. ID of the job.
  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 | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # 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.
  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 | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  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 | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # 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.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  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 | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # 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?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  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 | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | 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?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # A list of steps to run.

Определения, ссылающиеся на это определение: задания

Свойства

job Строка. Требуется в качестве первого свойства.
Идентификатор задания. Допустимые значения. Допустимые имена могут содержать только буквенно-цифровые символы и "_" и не могут начинаться с числа.

displayName Строка.
Понятное для человека имя задания.

dependsOn строка | список строк.
Все задания, которые должны быть выполнены до этого.

condition Строка.
Оцените это выражение условия, чтобы определить, следует ли выполнять это задание.

continueOnError Строка.
Продолжить работу даже при сбое?

timeoutInMinutes Строка.
Время ожидания завершения этого задания, прежде чем сервер завершит его.

cancelTimeoutInMinutes Строка.
Время ожидания отмены задания до принудительного завершения его.

variablesпеременные.
Переменные, относящиеся к заданию.

strategyjobs.job.strategy.
Стратегия выполнения для этого задания.

poolпул.
Пул, в котором будет выполняться это задание.

containerjobs.job.container.
Имя ресурса контейнера.

services словарь строк.
Ресурсы контейнера для запуска в качестве контейнера службы.

workspaceрабочая область.
Параметры рабочей области в агенте. Дополнительные сведения о рабочих областях, включая параметры очистки, см. в разделе о рабочих областях в разделе Задания.

usesjobs.job.uses.
Все ресурсы, необходимые для этого задания, на которые еще нет ссылок. Дополнительные сведения о usesсм. в статье Ограничение область авторизации заданий в указанных репозиториях Azure DevOps.

stepsшаги.
Список шагов для выполнения.

templateContext templateContext.
Сведения, связанные с заданием, передаваемые из конвейера при расширении шаблона. Дополнительные сведения см. в примечаниях. Дополнительные сведения о templateContextсм. в разделах Расширенные шаблоны конвейеров YAML теперь можно передавать контекстные сведения для этапов, заданий и развертываний и Шаблоны — использование templateContext для передачи свойств в шаблоны.

Комментарии

Значение по умолчанию timeoutInMinutes — 60 минут. Дополнительные сведения см. в разделе Время ожидания.

Задания могут выполняться условно и могут зависеть от более ранних заданий.

Примечание

Если у вас есть только один этап и одно задание, можно использовать синтаксис одного задания в качестве более короткого способа описания выполняемых шагов.

Примеры

jobs:
- job: MyJob
  displayName: My First Job
  continueOnError: true
  workspace:
    clean: outputs
  steps:
  - script: echo My first job

См. также раздел