definição jobs.deployment

Uma tarefa de implementação é um tipo especial de tarefa. É uma coleção de passos a executar sequencialmente no ambiente.

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

Definições que referenciam esta definição: tarefas

Propriedades

deployment cadeia. Necessário como primeira propriedade.
Nome da tarefa de implementação, A-Z, a-z, 0-9 e caráter de sublinhado. A palavra implementar é uma palavra-chave e não é suportada como o nome da implementação.

displayName cadeia.
Nome legível por humanos para a implementação.

dependsOn cadeia | lista de cadeias de carateres.
Todas as tarefas que têm de ser concluídas antes desta tarefa.

condition cadeia.
Avalie esta expressão de condição para determinar se deve executar esta implementação.

continueOnError cadeia.
Continuar a executar mesmo com falhas?

timeoutInMinutes cadeia.
Está na hora de esperar que esta tarefa seja concluída antes de o servidor o matar.

cancelTimeoutInMinutes cadeia.
Está na hora de esperar que a tarefa seja cancelada antes de a terminar à força.

variablesvariáveis.
Variáveis específicas da implementação.

poolconjunto.
Conjunto onde esta tarefa será executada.

environmentjobs.deployment.environment.
Nome do ambiente de destino e, opcionalmente, um nome de recurso para registar o histórico de implementações; format: environment-name.resource-name.

strategyjobs.deployment.strategy.
Estratégia de execução para esta implementação.

workspaceárea de trabalho.
Opções de área de trabalho no agente.

usesjobs.job.uses.
Todos os recursos necessários para esta tarefa que ainda não estão referenciados.

containerjobs.job.container.
Nome do recurso de contentor.

services dicionário de cadeia.
Recursos de contentor a executar como um contentor de serviço.

templateContext templateContext.
Informações relacionadas com a implementação transmitidas a partir de um pipeline ao expandir um modelo. Veja as observações para obter mais informações. Para obter mais informações sobre templateContexto , veja Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates - Use templateContext to pass properties to templates.

Observações

Nos pipelines YAML, a equipa de pipelines recomenda que coloque os passos de implementação numa tarefa de implementação.

Exemplos

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