Partilhar via


jobs.deployment definição

Um de trabalho de implantação é um tipo especial de trabalho. É uma coleção de etapas para 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: 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.
  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: 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.
  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: outputs | resources | all # What to clean up before the job runs.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs

Definições que fazem referência a esta definição: empregos

Propriedades

deployment string. Obrigatório como primeira propriedade.
Nome do trabalho de implantação, A-Z, a-z, 0-9 e sublinhado. A palavra deploy é uma palavra-chave e não tem suporte como o nome da implantação.

displayName string.
Nome legível por humanos para a implantação.

dependsOn corda | lista de cadeias de caracteres.
Quaisquer trabalhos que devam ser concluídos antes deste.

condition string.
Avalie essa expressão de condição para determinar se essa implantação deve ser executada.

continueOnError string.
Continuar a correr mesmo em caso de falha?

timeoutInMinutes string.
Tempo para esperar que este trabalho seja concluído antes que o servidor o mate.

cancelTimeoutInMinutes string.
Hora de esperar que o trabalho seja cancelado antes de encerrá-lo à força.

variables variáveis.
Variáveis específicas da implantação.

pool piscina.
Pool onde este trabalho será executado.

environment jobs.deployment.environment.
Nome do ambiente de destino e, opcionalmente, um nome de recurso para registrar o histórico de implantação; formato: environment-name.resource-name.

strategy jobs.deployment.strategy.
Estratégia de execução para esta implantação.

workspace espaço de trabalho.
Opções de espaço de trabalho no agente.

Para obter mais informações sobre espaços de trabalho, incluindo opções limpas, consulte o tópico espaço de trabalho em Jobs.

uses jobs.job.uses.
Especifica os recursos exigidos por esse trabalho que ainda não foram referenciados em outro lugar do pipeline, por exemplo, por uma etapa de check-out ou um recurso de repositório. Para obter mais informações sobre useso , consulte Limitar o escopo de autorização de trabalho e a instrução "usa" para pré-declarar recursos.

container jobs.job.container.
Nome do recurso de contêiner.

services dicionário de cordas.
Recursos de contêiner para serem executados como um contêiner de serviço.

templateContext templateContext.
Informações relacionadas à implantação passadas de um pipeline ao estender um modelo. Ver observações para mais informações. Para obter mais informações sobre templateContext, consulte Modelos de pipelines YAML estendidos agora podem ser passados informações de contexto para estágios, trabalhos e implantações e Modelos - Use templateContext para passar propriedades para modelos.

Observações

Em pipelines YAML, a equipe de pipelines recomenda que você coloque suas etapas de implantação em um trabalho de implantação.

Para obter mais informações sobre templateContext, consulte Modelos de pipelines YAML estendidos agora podem ser passados informações de contexto para estágios, trabalhos e implantações e Modelos - Use templateContext para passar propriedades para modelos.

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