Skip to content

Commit

Permalink
Add better error handling in Prepare-Release (Azure#18590)
Browse files Browse the repository at this point in the history
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
  • Loading branch information
azure-sdk and weshaggard authored May 8, 2021
1 parent 11008ec commit 1998f3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions eng/common/scripts/Prepare-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ if ($null -eq $newVersionParsed)
-packageType $packageProperties.SDKType `
-packageNewLibrary $packageProperties.IsNewSDK

if ($LASTEXITCODE -ne 0) {
Write-Error "Updating of the Devops Release WorkItem failed."
exit 1
}

if ($releaseTrackingOnly)
{
Write-Host
Expand Down
10 changes: 8 additions & 2 deletions eng/common/scripts/Update-DevOps-Release-WorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ param(
Set-StrictMode -Version 3

if (!(Get-Command az -ErrorAction SilentlyContinue)) {
Write-Host 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
Write-Error 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
exit 1
}

az extension show -n azure-devops > $null
az account show *> $null
if (!$?) {
Write-Host 'Running az login...'
az login *> $null
}

az extension show -n azure-devops *> $null
if (!$?){
Write-Host 'Installing azure-devops extension'
az extension add --name azure-devops
Expand Down

0 comments on commit 1998f3b

Please sign in to comment.