add cleanup script for docker windows machine

pull/10838/head
Sharif Elgamal 2021-03-15 14:06:11 -07:00
parent f95d43a2c7
commit 781e3ea105
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,20 @@
function Jenkins {
Get-Process e2e-windows-amd64 2>$NULL
if ($?) {
return $TRUE
}
return $FALSE
}
if (Jenkins) {
exit 0
}
echo "waiting to see if any jobs are coming in..."
timeout 30
if (Jenkins) {
exit 0
}
echo "doing it"
docker system prune --all --force
Get-Process "*Docker Desktop*" | Stop-Process
shutdown /r

View File

@ -0,0 +1 @@
Schtasks /create /tn cleanup_reboot /sc HOURLY /tr "Powershell gsutil -m cp gs://minikube-builds/master/windows_cleanup_and_reboot_docker.ps1 C:\Users\jenkins; C:\Users\jenkins\windows_cleanup_and_reboot_docker.ps1"