definição de jobs.job

Um trabalho é uma coleção de etapas executadas por um agente ou em um servidor.

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.

Definições que fazem referência a essa definição: trabalhos

Propriedades

job String. Obrigatório como primeira propriedade.
ID do trabalho. Valores aceitáveis: nomes válidos só podem conter caracteres alfanuméricos e '_' e podem não começar com um número.

displayName String.
Nome legível para o trabalho.

dependsOn cadeia de caracteres | lista de cadeias de caracteres.
Todos os trabalhos que devem ser concluídos antes deste.

condition String.
Avalie essa expressão de condição para determinar se este trabalho deve ser executado.

continueOnError String.
Continuar em execução mesmo em caso de falha?

timeoutInMinutes String.
Tempo para aguardar a conclusão desse trabalho antes que o servidor o mate.

cancelTimeoutInMinutes String.
Tempo para aguardar o cancelamento do trabalho antes de encerrá-lo à força.

variablesvariáveis.
Variáveis específicas do trabalho.

strategyjobs.job.strategy.
Estratégia de execução para este trabalho.

poolpool.
Pool em que esse trabalho será executado.

containerjobs.job.container.
Nome do recurso de contêiner.

services dicionário de cadeia de caracteres.
Recursos de contêiner a serem executados como um contêiner de serviço.

workspaceworkspace.
Opções de workspace no agente. Para obter mais informações sobre workspaces, incluindo opções de limpeza, confira o tópico do workspace em Trabalhos.

usesjobs.job.uses.
Todos os recursos exigidos por esse trabalho que ainda não foram referenciados. Para obter mais informações sobre uses, confira Limitar o escopo de autorização de trabalho para os repositórios do Azure DevOps referenciados.

stepsetapas.
Uma lista de etapas a serem executadas.

templateContext templateContext.
Informações relacionadas ao trabalho passadas de um pipeline ao estender um modelo. Confira comentários para obter mais informações. Para obter mais informações sobre templateContext, consulte Modelos de Pipelines YAML estendidos agora podem ser passados informações de contexto para estágios, trabalhos e implantações e modelos – Use templateContext para passar propriedades para modelos.

Comentários

O padrão timeoutInMinutes é definido como 60 minutos. Para obter mais informações, consulte Tempos limite.

Os trabalhos podem ser executados condicionalmente e podem depender de trabalhos anteriores.

Observação

Se você tiver apenas uma fase e um trabalho, poderá usar a sintaxe de trabalho único como uma maneira mais curta de descrever as etapas a serem executadas.

Exemplos

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

Confira também