[images.CI] Delete macOS VMs on build canceling (#1742)

* destroy vm

* destroy vm

* check clone status

* fix vm state

* remove exit 1

* fix params

* suppress stop-vm output

* replace or -> Or

* rename doc terms
This commit is contained in:
Aleksandr Chebotov
2020-10-08 15:27:39 +03:00
committed by GitHub
parent 0a35359f4b
commit cb16dfc174
2 changed files with 100 additions and 0 deletions
@@ -105,3 +105,14 @@ jobs:
failTaskOnFailedTests: true
displayName: Publish test results
condition: always()
- task: PowerShell@2
displayName: 'Destroy VM (if build canceled only)'
condition: eq(variables['Agent.JobStatus'], 'Canceled')
inputs:
targetType: 'filePath'
filePath: ./images.CI/macos/destroy-vm.ps1
arguments: -VMName "${{ variables.VirtualMachineName }}" `
-VIServer "$(vcenter-server-v2)" `
-VIUserName "$(vcenter-username-v2)" `
-VIPassword "$(vcenter-password-v2)"