From ac5e5e3bbcf6d0decb6962a7148f8a1373eafd1d Mon Sep 17 00:00:00 2001 From: cage200 Date: Tue, 12 May 2020 17:47:44 +0200 Subject: [PATCH] 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. --- images.CI/azure-pipelines/image-generation.yml | 3 ++- images.CI/cleanup.ps1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/images.CI/azure-pipelines/image-generation.yml b/images.CI/azure-pipelines/image-generation.yml index 03b084ca8..d2adc15ae 100644 --- a/images.CI/azure-pipelines/image-generation.yml +++ b/images.CI/azure-pipelines/image-generation.yml @@ -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) \ No newline at end of file + -TenantId $(AZURE_TENANT) diff --git a/images.CI/cleanup.ps1 b/images.CI/cleanup.ps1 index 00050d551..31abcb56a 100644 --- a/images.CI/cleanup.ps1 +++ b/images.CI/cleanup.ps1 @@ -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