Skip to content

Commit

Permalink
Fix error in the vPack release, debug script that blocked release (#2…
Browse files Browse the repository at this point in the history
…3904)

* 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 <tessgauthier@microsoft.com>
  • Loading branch information
TravisEz13 and tgauth committed Jun 10, 2024
1 parent 7794503 commit 7108ae0
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions .pipelines/PowerShell-vPack-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:'
Expand All @@ -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
Expand All @@ -66,10 +64,10 @@ extends:
parameters:
platform:
name: 'windows_undocked' # windows undocked

cloudvault:
enabled: false

globalSdl:
useCustomPolicy: true # for signing code
disableLegacyManifest: true
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 7108ae0

Please sign in to comment.