Partager via


jobs.job definition

Un travail est une collection d’étapes exécutées par un agent ou sur un serveur.

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.

Définitions qui font référence à cette définition : travaux

Propriétés

job String. Obligatoire comme première propriété.
ID du travail. Valeurs acceptables : les noms valides peuvent contenir uniquement des caractères alphanumériques et « _ » et ne peuvent pas commencer par un nombre.

displayName String.
Nom lisible par l’homme pour le travail.

dependsOn string | liste de chaînes.
Tous les travaux qui doivent être terminés avant celui-ci.

condition String.
Évaluez cette expression de condition pour déterminer s’il faut exécuter ce travail.

continueOnError String.
Continuez à exécuter même en cas d’échec ?

timeoutInMinutes String.
Il est temps d’attendre que ce travail se termine avant que le serveur l’arrête.

cancelTimeoutInMinutes String.
Il est temps d’attendre que le travail s’annule avant de l’arrêter de force.

variablesvariables.
Variables spécifiques au travail.

strategyjobs.job.strategy.
Stratégie d’exécution pour ce travail.

poolpool.
Pool dans lequel ce travail s’exécutera.

containerjobs.job.container.
Nom de la ressource de conteneur.

services dictionnaire de chaînes.
Ressources de conteneur à exécuter en tant que conteneur de service.

workspaceespace de travail.
Options de l’espace de travail sur l’agent. Pour plus d’informations sur les espaces de travail, y compris les options de nettoyage, consultez la rubrique Espace de travail dans Travaux.

usesjobs.job.uses.
Toutes les ressources requises par ce travail qui ne sont pas déjà référencées. Pour plus d’informations sur uses, consultez Limiter l’étendue d’autorisation de travail aux référentiels Azure DevOps référencés.

stepsétapes.
Liste des étapes à exécuter.

templateContext templateContext.
Informations relatives au travail transmises à partir d’un pipeline lors de l’extension d’un modèle. Pour plus d’informations, consultez les remarques. Pour plus d’informations sur templateContext, consultez Les modèles de pipelines YAML étendus peuvent désormais être transmis des informations de contexte pour les étapes, les travaux et les déploiements et Modèles - Utiliser templateContext pour passer des propriétés aux modèles.

Notes

La valeur par défaut timeoutInMinutes est de 60 minutes. Pour plus d’informations, consultez Délais d’expiration.

Les travaux peuvent s’exécuter de manière conditionnelle et peuvent dépendre de travaux antérieurs.

Notes

Si vous n’avez qu’une étape et un seul travail, vous pouvez utiliser la syntaxe à travail unique comme moyen plus court de décrire les étapes à exécuter.

Exemples

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

Voir aussi