Редактиране

Споделяне чрез


Deployment group jobs

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Deployment groups in Classic pipelines make it easy to define groups of target servers for deployment. Tasks that you define in a deployment group job run on some or all of the target servers, depending on the arguments you specify for the tasks and the job itself.

You can select specific sets of servers from a deployment group to receive the deployment by specifying the machine tags that you've defined for each server in the deployment group. You can also specify the proportion of the target servers that the pipeline should deploy to at the same time. This ensures that the app running on these servers is capable of handling requests while the deployment is taking place.

If you're using a YAML pipeline, you should use Environments with virtual machines instead.

Note

Deployment group jobs are not supported in YAML. You can use Virtual machine resources in Environments to do a rolling deployment to VMs in YAML pipelines.

Rolling deployments can be configured by specifying the keyword rolling: under strategy: node of a deployment job.

strategy:
  rolling:
    maxParallel: [ number or percentage as x% ]
    preDeploy:        
      steps:
      - script: [ script | bash | pwsh | powershell | checkout | task | templateReference ]
    deploy:          
      steps:
      ...
    routeTraffic:         
      steps:
      ...        
    postRouteTraffic:          
      steps:
      ...
    on:
      failure:         
        steps:
        ...
      success:          
        steps:
        ...

YAML builds aren't available.

Timeouts

Use the job timeout to specify the timeout in minutes for jobs in this job. A zero value for this option means that the timeout is effectively infinite and so, by default, jobs run until they complete or fail. You can also set the timeout for each task individually - see task control options. Jobs targeting Microsoft-hosted agents have additional restrictions on how long they may run.