Skip to content

Instantly share code, notes, and snippets.

@beachside-project
Created June 30, 2023 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beachside-project/52f7cbf2cc2396bc99fa0f15dbe799ff to your computer and use it in GitHub Desktop.
Save beachside-project/52f7cbf2cc2396bc99fa0f15dbe799ff to your computer and use it in GitHub Desktop.
Azure DevOps matrix sample
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