definice jobs.job

Úloha je kolekce kroků spuštěných agentem nebo na serveru.

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.

Definice, které odkazují na tuto definici: úlohy

Vlastnosti

job Řetězec. Povinný argument jako první vlastnost.
ID úlohy. Přijatelné hodnoty: Platné názvy můžou obsahovat pouze alfanumerické znaky a _a nesmí začínat číslem.

displayName Řetězec.
Lidsky čitelný název pro práci.

dependsOn string | seznam řetězců.
Všechny úlohy, které musí být dokončeny před touto úlohou.

condition Řetězec.
Vyhodnoťte tento výraz podmínky a určete, jestli se má tato úloha spustit.

continueOnError Řetězec.
Chcete pokračovat v provozu i při selhání?

timeoutInMinutes Řetězec.
Doba čekání na dokončení této úlohy, než ji server ukončí.

cancelTimeoutInMinutes Řetězec.
Čas počkat, než se úloha zruší, než ji vynutím ukončení.

variablesproměnné.
Proměnné specifické pro úlohu.

strategyjobs.job.strategy.
Strategie provádění pro tuto úlohu

poolbazén.
Fond, ve kterém se tato úloha spustí.

containerjobs.job.container.
Název prostředku kontejneru.

services řetězcový slovník.
Prostředky kontejneru, které se mají spustit jako kontejner služby.

workspacepracovního prostoru.
Možnosti pracovního prostoru v agentu. Další informace o pracovních prostorech, včetně možností čištění, najdete v tématu o pracovním prostoru v tématu Úlohy.

usesjobs.job.uses.
Všechny prostředky vyžadované touto úlohou, na které se ještě neodkazuje. Další informace o usesnajdete v tématu Omezení rozsahu autorizace úloh na odkazovaná úložiště Azure DevOps.

stepskroky.
Seznam kroků, které se mají spustit.

templateContext templateContext.
Informace související s úlohou předávané z kanálu při rozšiřování šablony Další informace najdete v poznámkách. Další informace o templateContextnástroji najdete v tématu Šablony rozšířených kanálů YAML se teď dají předávat kontextové informace pro fáze, úlohy a nasazení a Šablony– Předávání vlastností šablonám pomocí templateContext.

Poznámky

Výchozí hodnota timeoutInMinutes je nastavená na 60 minut. Další informace najdete v tématu Vypršení časových limitů.

Úlohy můžou běžet podmíněně a můžou záviset na dřívějších úlohách.

Poznámka

Pokud máte jenom jednu fázi a jednu úlohu, můžete použít syntaxi jedné úlohy jako kratší způsob popisu kroků, které se mají spustit.

Příklady

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

Viz také