From 7108ae0027fa2ff2c16155c76e721ac100e5fc19 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 10 Jun 2024 14:22:55 -0700 Subject: [PATCH] Fix error in the vPack release, debug script that blocked release (#23904) * Update PowerShell-vPack-Official.yml for Azure Pipelines * Merged PR 31369: fix version override parameter - change default value of override version parameter to make actually optional - eliminate redundant version override variable and use parameter directly * Fix condition * remove trailing spaces * remove other syntax issue --------- Co-authored-by: Tess Gauthier --- .pipelines/PowerShell-vPack-Official.yml | 33 ++++++++++-------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/.pipelines/PowerShell-vPack-Official.yml b/.pipelines/PowerShell-vPack-Official.yml index afb5124e0e..b944449761 100644 --- a/.pipelines/PowerShell-vPack-Official.yml +++ b/.pipelines/PowerShell-vPack-Official.yml @@ -22,7 +22,7 @@ parameters: # parameters are shown up in ADO UI in a build queue time - name: 'VPackPublishOverride' type: string displayName: 'VPack Publish Override Version (can leave blank):' - default: '' + default: ' ' - name: 'ReleaseTagVar' type: string displayName: 'Release Tag Var:' @@ -38,24 +38,22 @@ variables: - name: BuildConfiguration value: Release - name: WindowsContainerImage - value: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest' + value: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest' - name: Codeql.Enabled - value: false # pipeline is not building artifacts; it repackages existing artifacts into a vpack + value: false # pipeline is not building artifacts; it repackages existing artifacts into a vpack - name: DOTNET_CLI_TELEMETRY_OPTOUT value: 1 - name: POWERSHELL_TELEMETRY_OPTOUT value: 1 - name: nugetMultiFeedWarnLevel value: none - - name: VPackPublishOverride - value: ${{ parameters.VPackPublishOverride }} - name: ReleaseTagVar value: ${{ parameters.ReleaseTagVar }} - group: Azure Blob variable group - group: certificate_logical_to_actual # used within signing task resources: - repositories: + repositories: - repository: templates type: git name: OneBranch.Pipelines/GovernedTemplates @@ -66,10 +64,10 @@ extends: parameters: platform: name: 'windows_undocked' # windows undocked - + cloudvault: enabled: false - + globalSdl: useCustomPolicy: true # for signing code disableLegacyManifest: true @@ -102,10 +100,10 @@ extends: jobs: - job: main pool: - type: windows - + type: windows + variables: - ob_outputDirectory: '$(BUILD.SOURCESDIRECTORY)\out' + ob_outputDirectory: '$(BUILD.SOURCESDIRECTORY)\out' ob_createvpack_enabled: ${{ parameters.createVPack }} ob_createvpack_packagename: 'PowerShell.${{ parameters.architecture }}' ob_createvpack_description: PowerShell ${{ parameters.architecture }} $(version) @@ -121,18 +119,13 @@ extends: ReleaseTagVar: $(ReleaseTagVar) CreateJson: yes UseJson: no - + - pwsh: | if($env:RELEASETAGVAR -match '-') { throw "Don't release a preview build without coordinating with Windows Engineering Build Tools Team" } displayName: Stop any preview release - - pwsh: - Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" - displayName: Set Build Name for Non-PR - condition: ne(variables['Build.Reason'], 'PullRequest') - - task: UseDotNet@2 displayName: 'Use .NET Core sdk' inputs: @@ -186,17 +179,17 @@ extends: - pwsh: | Write-Verbose "VPack Version: $(ob_createvpack_version)" -Verbose Get-ChildItem -Path $(ob_outputDirectory)\* -Recurse - Get-Content $(ob_outputdirectory)\preview.json | Write-Host + Get-Content $(ob_outputdirectory)\preview.json -ErrorAction SilentlyContinue | Write-Host displayName: Debug Output Directory and Version condition: succeededOrFailed() - pwsh: | Write-Host "Using VPackPublishOverride variable" - $vpackVersion = '$(VPackPublishOverride)' + $vpackVersion = '${{ parameters.VPackPublishOverride }}' $vstsCommandString = "vso[task.setvariable variable=ob_createvpack_version]$vpackVersion" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" - condition: and(ne(variables.VPackPublishOverride, ''), ne(variables.VPackPublishOverride, 'None')) + condition: ne('${{ parameters.VPackPublishOverride }}', ' ') displayName: 'Set ob_createvpack_version with VPackPublishOverride' - pwsh: |