Skip to content

Commit

Permalink
Control ADO-Maestro job using variable (#1083)
Browse files Browse the repository at this point in the history
* Use coalesce pattern with queue-time variable
  • Loading branch information
j0shuams authored Jan 21, 2022
1 parent d60484d commit 0b7b73f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 1 addition & 4 deletions build/AzurePipelineTemplates/CsWinRT-Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ stages:

- template: CsWinRT-PublishToNuget-Stage.yml

- template: CsWinRT-PublishToMaestro-Stage.yml
parameters:
${{ if eq(variables['PrereleaseVersion'], '') }}:
IsRelease: true
- template: CsWinRT-PublishToMaestro-Stage.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
parameters:
IsRelease: ''

stages:
- stage: PublishToMaestro
displayName: Trigger Maestro Publish
jobs:
- job: TriggerMaestroPublish
condition: eq('${{ parameters.IsRelease }}','true')
condition: eq(variables['_IsRelease'],'true')
variables:
_DotNetCoreRuntimeVersion: 5.0.11 # matches with SDK v. 5.0.402
_WindowsSdkPackageVersion: 10.0.18362.22 # matches with one consumed in WindowsAppSdk
Expand Down
4 changes: 4 additions & 0 deletions build/AzurePipelineTemplates/CsWinRT-Variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ variables:
Net6.SDK.Version: '6.0.100-rc.2.21505.57'
NoSamples: 'false'

# This 'coalesce' pattern allows the yml to define a default value for a variable but allows the value to be overridden at queue time.
# E.g. '_IsRelease' defaults to empty string, but if 'IsRelease' is set at queue time that value will be used.

_IsRelease: $[coalesce(variables.IsRelease, '')]

0 comments on commit 0b7b73f

Please sign in to comment.