Matrix jobs execute the same script with different inputs
Inputs are specified using environment variables
The matrix
keyword under parallel
defines variables sets
job_name:
parallel:
matrix:
- FOO: bar
BAR: meh
- FOO: baz
BAR: [moo meh]
- FOO: [ABC CED FGH]
BAR: ruff
Matrix variables can be used for…
Maximum of 200 parallel jobs
job_name:
parallel:
matrix:
- STAGE: [ qa, live ]
image: reg.comp.org/${STAGE}/image:tag
script: echo "${STAGE}"
See chapter Matrix jobs
needs
XXX extended syntax
linux:build:
stage: build
script: echo "Building linux..."
parallel:
matrix:
- PROVIDER: aws
STACK:
- monitoring
- app1
- app2
linux:rspec:
stage: test
needs:
- job: linux:build
parallel:
matrix:
- PROVIDER: aws
STACK: app1
script: echo "Running rspec on linux..."