Background
As I understand it, when creating a release pipeline in classic mode in Azure DevOps, you are provided the option to run your job with the Parallelism
Execution plan. Once you select that plan, you can provide a Multipliers
variable(s) that will run your job once for every multiplier variable you provide, switching out the variable value for every value in your comma separated string.
So for example, if I created the following release pipeline job:
And provided the following pipeline variable:
My pipeline would be run 3 times – once for each variable value.
Question
Is it possible to do the same thing with yml for a build pipeline?
The closes thing I found is the parallel job strategy but that provides no option for a Multiplier variable.
2
Answers
Upon further investigation, I think I found the answer.
We can use the matrix strategy combined with some simple logic to expand a pipeline variable into multiple values via bash.
Another option to run multiple jobs in parallel would be to use the each keyword to loop through parameters and generate a job for each option.
Example:
Running the build:
Note:
maxParallel
property).