为什么我们要一次构建多个构建机器的同一个项目?

why do we want to build the same project more than one build machine at a time?

对此设置感到困惑。当一个项目有多个并发构建时,这怎么有意义。

您正在查看构建阶段的执行计划。

The manner in which run is parallelized.

None: Tasks will run on a single agent.

Multi-configuration: Run the same set of tasks on multiple configurations as specified in the multipliers. Configurations will run in parallel and each configuration will use a single agent. Total number of agents used by the phase will depend on the number of configurations, and can be limited by specifying the maximum number of agents.

Multi-agent: Run the same set of tasks on multiple agents, using the exact number of agents specified.

More information

设置不是关于构建,而是关于阶段(阶段中的任务)。您可以并行多次执行同一阶段以缩短构建时间。当然你需要一个适合这个的task/phase

首先,现在是用于release,一般情况下,release是用来deploy的(build中也有同样的设置,但是不行)。

其次,任务是相同的,但变量的值可以不同,也有一些任务可以运行或不是通过task conditions.

例如:

  1. 将 PowerShell 任务添加到发布定义

根据代理名称设置变量值的脚本

param(
[string]$a
)
 Write-Host $a
if($s -eq "XXX"){
Write-Host "##vso[task.setvariable variable=webname]devWeb"
}
else
{
Write-Host "##vso[task.setvariable variable=webname]ReleaseWeb"
}

参数:-a $(Agent.Name)

Logging Commands

  1. 然后下面的任务可以使用不同值的这个变量(webname)。