mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 10:09:20 +08:00
Configure yml files for the images
This commit is contained in:
25
images.CI/cleanup.ps1
Normal file
25
images.CI/cleanup.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
param(
|
||||
[ValidateSet('Windows2019-Azure','Windows2016-Azure','ubuntu1604','ubuntu1804')]
|
||||
[String] [Parameter (Mandatory=$true)] $Image,
|
||||
[String] [Parameter (Mandatory=$true)] $ResourcesNamePrefix,
|
||||
[String] [Parameter (Mandatory=$true)] $ClientId,
|
||||
[String] [Parameter (Mandatory=$true)] $ClientSecret,
|
||||
[String] [Parameter (Mandatory=$true)] $SubscriptionId,
|
||||
[String] [Parameter (Mandatory=$true)] $TenantId
|
||||
)
|
||||
|
||||
az login --service-principal --username $ClientId --password $ClientSecret --tenant $TenantId | Out-Null
|
||||
|
||||
$TempResourceGroupName = "${ResourcesNamePrefix}_${Image}"
|
||||
|
||||
Write-Host "ResourcesNamePrefix = $ResourcesNamePrefix"
|
||||
Write-Host "TempResourceGroupName = $TempResourceGroupName"
|
||||
|
||||
$groupExist = az group exists --name $TempResourceGroupName --subscription $SubscriptionId | Out-Null
|
||||
if ($groupExist -eq "true") {
|
||||
Write-Host "Found a match, deleting temporary files"
|
||||
az group delete --name $TempResourceGroupName --subscription $SubscriptionId --yes | Out-Null
|
||||
Write-Host "Temporary group was deleted succesfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "No temporary groups found"
|
||||
}
|
||||
Reference in New Issue
Block a user