Fix the cleanup script. (#856)

* Fix the cleanup script.The result is not returned to the variable because of the output redirect

* Added the cancel timeout.
This commit is contained in:
cage200
2020-05-12 17:47:44 +02:00
committed by GitHub
parent 084ff7e1e4
commit ac5e5e3bbc
2 changed files with 3 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ jobs:
- job:
pool: ci-agent-pool
timeoutInMinutes: 600
cancelTimeoutInMinutes: 30
variables:
- group: Image Generation Variables
@@ -74,4 +75,4 @@ jobs:
-ClientSecret $(CLIENT_SECRET) `
-Image ${{ parameters.image_type }} `
-SubscriptionId $(AZURE_SUBSCRIPTION) `
-TenantId $(AZURE_TENANT)
-TenantId $(AZURE_TENANT)

View File

@@ -11,7 +11,7 @@ az login --service-principal --username $ClientId --password $ClientSecret --ten
$TempResourceGroupName = "${ResourcesNamePrefix}_${Image}"
$groupExist = az group exists --name $TempResourceGroupName --subscription $SubscriptionId | Out-Null
$groupExist = az group exists --name $TempResourceGroupName --subscription $SubscriptionId
if ($groupExist -eq "true") {
Write-Host "Found a match, deleting temporary files"
az group delete --name $TempResourceGroupName --subscription $SubscriptionId --yes | Out-Null