Compartir a través de


definición de jobs.deployment

Un trabajo de implementación es un tipo especial de trabajo. Es una colección de pasos que se ejecutan secuencialmente en el entorno.

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

Definiciones que hacen referencia a esta definición: trabajos

Propiedades

deployment Cadena. Obligatorio como primera propiedad.
Nombre del trabajo de implementación, A-Z, a-z, 0-9 y subrayado. La palabra deploy es una palabra clave y no se admite como nombre de implementación.

displayName Cadena.
Nombre legible para la implementación.

dependsOn string | lista de cadenas.
Todos los trabajos que deben completarse antes de este.

condition Cadena.
Evalúe esta expresión de condición para determinar si se va a ejecutar esta implementación.

continueOnError Cadena.
¿Sigue ejecutándose incluso en caso de error?

timeoutInMinutes Cadena.
Tiempo de espera para que este trabajo se complete antes de que el servidor lo mate.

cancelTimeoutInMinutes Cadena.
Tiempo de espera para que el trabajo se cancele antes de terminarlo forzosamente.

variablesvariables.
Variables específicas de la implementación.

poolpool.
Grupo donde se ejecutará este trabajo.

environmentjobs.deployment.environment.
Nombre del entorno de destino y, opcionalmente, un nombre de recurso para registrar el historial de implementación; format: environment-name.resource-name.

strategyjobs.deployment.strategy.
Estrategia de ejecución para esta implementación.

workspaceárea de trabajo.
Opciones del área de trabajo en el agente.

usesjobs.job.uses.
Todos los recursos requeridos por este trabajo que aún no se han hecho referencia.

containerjobs.job.container.
Nombre del recurso de contenedor.

services diccionario de cadenas.
Recursos de contenedor para ejecutarse como contenedor de servicios.

templateContext templateContext.
Información relacionada con la implementación que se pasa desde una canalización al extender una plantilla. Consulte la sección Comentarios para obtener más información. Para obtener más información sobre templateContext, vea Plantillas de canalizaciones yaML extendidas ahora se puede pasar información de contexto para fases, trabajos e implementaciones yplantillas: usar templateContext para pasar propiedades a plantillas.

Observaciones

En las canalizaciones de YAML, el equipo de canalizaciones recomienda colocar los pasos de implementación en un trabajo de implementación.

Ejemplos

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