summaryrefslogtreecommitdiff
path: root/eng/common/templates/post-build/setup-maestro-vars.yml
blob: f6120dc1e1ce02d5116cee483f84fd4f9714fe7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
jobs:
- job: setupMaestroVars
  displayName: Setup Maestro Vars
  pool:
    vmImage: 'windows-2019'
  steps:
    - task: DownloadBuildArtifacts@0
      displayName: Download Release Configs
      inputs:
        buildType: current
        artifactName: ReleaseConfigs

    - task: PowerShell@2
      name: setReleaseVars
      displayName: Set Release Configs Vars
      inputs:
        targetType: inline
        script: |
          # This is needed to make Write-PipelineSetVariable works in this context
          $ci = $true

          . "$(Build.SourcesDirectory)/eng/common/tools.ps1"

          $Content = Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt"

          $BarId = $Content | Select -Index 0

          $Channels = ""            
          $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," }
            
          $IsStableBuild = $Content | Select -Index 2

          Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId
          Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels"
          Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild