Created
June 30, 2023 00:53
-
-
Save beachside-project/52f7cbf2cc2396bc99fa0f15dbe799ff to your computer and use it in GitHub Desktop.
Azure DevOps matrix sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: matrix1 | |
stages: | |
- stage: matrix_demo | |
jobs: | |
- job: job_a | |
pool: | |
vmImage: ubuntu-latest | |
steps: | |
- powershell: | | |
$val = '{ "proj1": { "PramA": "proj1-val-A", "PramB": "proj1-val-B" }, "proj2": { "PramA": "proj2-val-A", "PramB": "proj2-val-B" }, "proj3": { "PramA": "proj3-val-A", "PramB": "proj3-val-B" } }' | |
echo "##vso[task.setvariable variable=matrix;isOutput=true]$val" | |
name: targetList | |
- job: job_b | |
dependsOn: job_a | |
pool: | |
vmImage: ubuntu-latest | |
strategy: | |
matrix: $[ dependencies.job_a.outputs['targetList.matrix'] ] | |
maxParallel: 3 | |
steps: | |
- script: | | |
echo '$(PramA)' | |
echo '$(PramB)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment