definicja jobs.deployment

Zadanie wdrożenia jest specjalnym typem zadania. Jest to zbiór kroków, które należy uruchamiać sekwencyjnie względem środowiska.

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

Definicje odwołujące się do tej definicji: zadania

Właściwości

deployment Ciąg. Wymagane jako pierwsza właściwość.
Nazwa zadania wdrożenia, A-Z, a-z, 0-9 i podkreślenie. Słowo deploy jest słowem kluczowym i nie jest obsługiwane jako nazwa wdrożenia.

displayName Ciąg.
Czytelna dla człowieka nazwa wdrożenia.

dependsOn ciąg | lista ciągów.
Wszystkie zadania, które muszą zostać ukończone przed tym.

condition Ciąg.
Oceń to wyrażenie warunku, aby określić, czy należy uruchomić to wdrożenie.

continueOnError Ciąg.
Czy kontynuować działanie nawet w przypadku awarii?

timeoutInMinutes Ciąg.
Czas oczekiwania na ukończenie tego zadania, zanim serwer go zabije.

cancelTimeoutInMinutes Ciąg.
Czas oczekiwania na anulowanie zadania przed wymuszonym jego zakończeniem.

variableszmienne.
Zmienne specyficzne dla wdrożenia.

poolpula.
Pula, w której zostanie uruchomione to zadanie.

environmentjobs.deployment.environment.
Nazwa środowiska docelowego i opcjonalnie nazwa zasobu do rejestrowania historii wdrożenia; format: environment-name.resource-name.

strategyjobs.deployment.strategy.
Strategia wykonywania dla tego wdrożenia.

workspaceobszar roboczy.
Opcje obszaru roboczego w agencie.

usesjobs.job.uses.
Wszystkie zasoby wymagane przez to zadanie, do których jeszcze nie odwołuje się odwołanie.

containerjobs.job.container.
Nazwa zasobu kontenera.

services słownik ciągów.
Zasoby kontenera do uruchomienia jako kontener usługi.

templateContext templateContext.
Informacje dotyczące wdrażania przekazywane z potoku podczas rozszerzania szablonu. Zobacz uwagi, aby uzyskać więcej informacji. Aby uzyskać więcej informacji na temat templateContextprogramu , zobacz Rozszerzone szablony potoków YAML można teraz przekazywać informacje kontekstowe dla etapów, zadań i wdrożeń oraz szablonów— użyj szablonuContext, aby przekazać właściwości do szablonów.

Uwagi

W potokach YAML zespół potoków zaleca umieszczenie kroków wdrażania w zadaniu wdrożenia.

Przykłady

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