I typically use a personally hosted version of https://github.com/drone/drone for my CI (with Travis and Appveyor for OSX/Windows builds) but I thought I’d give gitlab CI a run.
However, I’ve found defining a matrix build to be hugely complicated. Is there a simpler way? The docs discuss using anchors for templates.
Contrast with drone / travis / appveyor which let me define a section like this
matrix:
SCALA_VERSION:
- 2.12.3
- 2.11.11
which means that the entire pipeline runs again with the environment variable set as defined here.
Yes this is not very powerful for more advanced builds, but it is a critical part of cross building in scala (which has multiple active versions).
While, technically, using YAML anchors is a solution there is a lot of boilerplate code with this. Which compromises readability.
We have pipelines with 3x4 components to mix, which requires us to write 12 chucks of the same code with just a label and a value different in each. Apart from the code not being particularly elegant and violating the DRY principle, maintaining it is severely error prone. To avoid human error we try to generate this code where it makes sense. All in all, this is a huge pain. Matrices should look like the example quoted by @fommil above to provide an abstract view on a concrete problem hiding the implementation details.
Complicated things must be easy to read! To allow us to get more complicated things done. With ease.
You, of course, completely correct. I agree with you. Hopefully the extends keywords with its deep-merge super-powers will ease things up. Coming with 11.3 on the 22nd or on an RC release in a repo next to you.
With the matrix keyword we can do it all in a single block, but also the result is visually grouped. (The screenshot above below is when you click on the job group box.)