问题
I would like to generate jobs in Azure Pipelines using the matrix strategy, but not by explicitly listing all possible combinations. Instead of doing:
matrix:
core211:
module: core
scala: 2.11
python211:
module: python
scala: 2.11
libraries211:
module: ibraries
scala: 2.11
core212:
module: core
scala: 2.12
python212:
module: python
scala: 2.12
libraries212:
module: libraries
scala: 2.12
I want to do
matrix:
combinations:
module: ["libraries", "python", "core"]
scala: ["2.11", "2.12"]
to generate above matrix. Is this possible with Azure Pipelines?
I got this approach from Travis CI.
回答1:
Is this possible with Azure Pipelines?
I'm afraid the answer is negative. For now, it's not a supported scenario.
About the Matrix schema in yaml please check this document:
strategy:
matrix: { string1: { string2: string3 } }
maxParallel: number
It equals to:
matrix:
string1:
string2: string3
.
.
.
string1:
string2: string3
.
.
.
According to the docs: For each string1 in the matrix, a copy of the job will be generated. string1 is the copy's name and will be appended to the name of the job.
So if we want to generate 6 jobs, for now we have to list 6 "string1
". (It means we do need to explicitly list all possible combinations...)
In addition:
Apart from the negative answer, I think what you want is a good idea! So I post a feature request here in DC forum. Anyone interested in this can vote for it and track it. Hope all above makes some help :)
来源:https://stackoverflow.com/questions/59076036/generate-job-matrix-from-all-possible-combinations-of-input-parameters