Megosztás a következőn keresztül:


jobs.job definition

A feladat egy ügynök által vagy kiszolgálónfuttatott lépések gyűjteménye.

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: outputs | resources | all # What to clean up before the job runs.
  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: outputs | resources | all # What to clean up before the job runs.
  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: outputs | resources | all # What to clean up before the job runs.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.

A definícióra hivatkozó definíciók: feladatok

Tulajdonságok

job sztring. Első tulajdonságként kötelező megadni.
feladat azonosítója. Elfogadható értékek: Az érvényes nevek csak alfanumerikus karaktereket és "_" karaktereket tartalmazhatnak, és nem kezdődhetnek számmal.

displayName sztring.
feladat ember által olvasható nevét.

dependsOn sztring | sztringlista.
Minden olyan feladat, amelynek előbb be kell fejeződnie.

condition sztring.
A feltételkifejezés kiértékelése annak meghatározásához, hogy futtassa-e ezt a feladatot.

continueOnError sztring.
Továbbra is fut a hiba?

timeoutInMinutes sztring.
Ideje megvárni, amíg a feladat befejeződik, mielőtt a kiszolgáló leáll.

cancelTimeoutInMinutes sztring.
Ideje megvárni a feladat megszakítását, mielőtt kényszeresen leállna.

variables változók.
feladatspecifikus változók.

strategy jobs.job.strategy.
feladat végrehajtási stratégiája.

pool készlet.
készletet, ahol a feladat futni fog.

container jobs.job.container.
tárolóerőforrás nevét.

services sztringszótár.
tárolóerőforrások szolgáltatástárolóként való futtatásához.

workspace munkaterület.
munkaterület beállításai az ügynökön. A munkaterületekkel kapcsolatos további információkért, beleértve a tiszta beállításokat is, tekintse meg munkaterület témakörét Feladatok.

uses jobs.job.használ.
A feladat által igényelt erőforrásokat határozza meg, amelyekre a folyamat más részén még nem hivatkoznak, például egy kivételi lépés vagy egy adattárerőforrás által. További információ: usesA feladatok engedélyezési hatókörének korlátozása és a "felhasználás" utasítás az erőforrások előzetes deklarálásához.

steps lépések.
Futtatandó lépések listája.

templateContext templateContext.
feladattal kapcsolatos információk, amelyek egy folyamatból származnak a sablon kiterjesztésekor. További információkért tekintse meg a megjegyzéseket. A templateContexttovábbi információ: A kiterjesztett YAML-folyamatsablonok mostantól átadhatók a fázisokra, feladatokra és üzembe helyezésekre vonatkozó környezeti információknak, és Sablonok – A templateContext használatával tulajdonságokat adhat át a sablonoknak.

Megjegyzések

Az alapértelmezett timeoutInMinutes 60 percre van állítva. További információ: időtúllépések.

A feladatok feltételesen futtathatók , és függhetnek a korábbi feladatoktól.

Megjegyzés

Ha csak egy szakaszból és egy feladatból áll, egyfeladatos szintaxissal rövidebben is leírhatja a futtatandó lépéseket.

A templateContexttovábbi információ: A kiterjesztett YAML-folyamatsablonok mostantól átadhatók a fázisokra, feladatokra és üzembe helyezésekre vonatkozó környezeti információknak, és Sablonok – A templateContext használatával tulajdonságokat adhat át a sablonoknak.

Példák

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

Lásd még