definice jobs.deployment

Úloha nasazení je speciální typ úlohy. Jedná se o kolekci kroků, které se v prostředí spouštějí postupně.

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

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

Vlastnosti

deployment Řetězec. Požadováno jako první vlastnost.
Název úlohy nasazení: A–Z, a–z, 0-9 a podtržítko. Slovo deploy je klíčové slovo a jako název nasazení se nepodporuje.

displayName Řetězec.
Název nasazení čitelný pro člověka.

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

condition Řetězec.
Vyhodnocením tohoto výrazu podmínky určete, jestli se má toto nasazení 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.
Doba čekání na zrušení úlohy před vynucením ukončení.

variablesproměnné.
Proměnné specifické pro nasazení.

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

environmentjobs.deployment.environment.
Název cílového prostředí a volitelně název prostředku pro záznam historie nasazení; format: název_prostředí.název-prostředku.

strategyjobs.deployment.strategy.
Strategie provádění pro toto nasazení

workspacepracovní prostor.
Možnosti pracovního prostoru v agentu

usesjobs.job.uses.
Všechny prostředky vyžadované touto úlohou, na které se již neodkazuje.

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

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

templateContext templateContext.
Informace související s nasazením 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ématech Š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 kanálech YAML tým kanálů doporučuje, abyste kroky nasazení umístili do úlohy nasazení.

Příklady

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