In my Azure DevOps pipeline I have the following:
strategy:
matrix:
unit_test_linux:
imageName: 'ubuntu-16.04'
TYPE: 'unit'
cucumber:
imageName: 'ubuntu-16.04'
TYPE: 'cucumber'
I want to use TYPE
in a step condition, a bit like below, how do I do this?
- bash: |
set -ev
cd ./client
npm install
displayName: install
env:
DISPLAY: ':99.0'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(${{'TYPE'}}, 'unit'))``
The matrix variable is like every variable, so in this way:
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['TYPE'], 'unit'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With