definition jobs.deployment

Ein Bereitstellungsauftrag ist ein besonderer Auftragstyp. Er ist eine Sammlung von Schritten, die nacheinander für die Umgebung ausgeführt werden.

jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  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.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  templateContext: # Deployment related information passed from a pipeline when extending a template.
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  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.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  workspace: # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs

Definitionen, die auf diese Definition verweisen: Aufträge

Eigenschaften

deployment Schnur. Erforderlich als erste Eigenschaft.
Name des Bereitstellungsauftrags, A-Z, a-z, 0-9 und Unterstrich. Das Wort deploy ist ein Schlüsselwort (keyword) und wird als Bereitstellungsname nicht unterstützt.

displayName Schnur.
Lesbarer Name für die Bereitstellung.

dependsOn Zeichenfolge | Zeichenfolgenliste.
Alle Aufträge, die vor diesem abgeschlossen werden müssen.

condition Schnur.
Werten Sie diesen Bedingungsausdruck aus, um zu bestimmen, ob diese Bereitstellung ausgeführt werden soll.

continueOnError Schnur.
Die Ausführung auch bei Einem Fehler fortsetzen?

timeoutInMinutes Schnur.
Zeit, bis dieser Auftrag abgeschlossen ist, bevor der Server ihn beendet.

cancelTimeoutInMinutes Schnur.
Zeit, auf den Abbruch des Auftrags zu warten, bevor er erzwungen wird.

variables-Variablen.
Bereitstellungsspezifische Variablen.

pool-Pool.
Pool, in dem dieser Auftrag ausgeführt wird.

environmentjobs.deployment.environment.
Name der Zielumgebung und optional ein Ressourcenname zum Aufzeichnen des Bereitstellungsverlaufs; format: environment-name.resource-name.

strategyjobs.deployment.strategy.
Ausführungsstrategie für diese Bereitstellung.

workspace-Arbeitsbereich.
Arbeitsbereichsoptionen auf dem Agent.

usesjobs.job.uses.
Alle ressourcen, die für diesen Auftrag erforderlich sind, auf die noch nicht verwiesen wird.

containerjobs.job.container.
Name der Containerressource.

services Zeichenfolgenwörterbuch.
Containerressourcen, die als Dienstcontainer ausgeführt werden sollen.

templateContext templateContext.
Bereitstellungsbezogene Informationen, die von einer Pipeline beim Erweitern einer Vorlage übergeben werden. Weitere Informationen finden Sie im Abschnitt "Hinweise". Weitere Informationen zu templateContextfinden Sie unter Erweiterte YAML-Pipelines-Vorlagen können jetzt kontextbezogene Informationen für Phasen, Aufträge und Bereitstellungen übergeben werden sowie Vorlagen – Verwenden von templateContext zum Übergeben von Eigenschaften an Vorlagen.

Bemerkungen

In YAML-Pipelines empfiehlt das Pipelineteam, dass Sie Ihre Bereitstellungsschritte in einen Bereitstellungsauftrag einfügen.

Beispiele

jobs:
  # track deployments on the environment
- deployment: DeployWeb
  displayName: deploy Web App
  pool:
    vmImage: ubuntu-latest
  # creates an environment if it doesn't exist
  environment: 'smarthotel-dev'
  strategy:
    # default deployment strategy, more coming...
    runOnce:
      deploy:
        steps:
        - script: echo my first deployment