cleanup the, uh, cleanup scripts
parent
b887c235e7
commit
d61c75cab1
|
@ -17,4 +17,9 @@ if (Jenkins) {
|
||||||
echo "doing it"
|
echo "doing it"
|
||||||
docker system prune --all --force --volumes
|
docker system prune --all --force --volumes
|
||||||
Get-Process "*Docker Desktop*" | Stop-Process
|
Get-Process "*Docker Desktop*" | Stop-Process
|
||||||
|
Get-VM | Where-Object {$_.Name -ne "DockerDesktopVM"} | Foreach {
|
||||||
|
Suspend-VM $_.Name
|
||||||
|
Stop-VM $_.Name -Force
|
||||||
|
Remove-VM $_.Name -Force
|
||||||
|
}
|
||||||
shutdown /r
|
shutdown /r
|
|
@ -1,27 +0,0 @@
|
||||||
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"
|
|
||||||
taskkill /IM putty.exe
|
|
||||||
taskkill /F /IM java.exe
|
|
||||||
Get-VM | Where-Object {$_.Name -ne "DockerDesktopVM"} | Foreach {
|
|
||||||
C:\var\jenkins\workspace\Hyper-V_Windows_integration\out\minikube-windows-amd64.exe delete -p $_.Name
|
|
||||||
Suspend-VM $_.Name
|
|
||||||
Stop-VM $_.Name -Force
|
|
||||||
Remove-VM $_.Name -Force
|
|
||||||
}
|
|
||||||
Remove-Item -path C:\Users\admin\.minikube -recurse -force
|
|
||||||
shutdown /r
|
|
|
@ -1 +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"
|
Schtasks /create /tn cleanup_reboot /sc HOURLY /tr "Powershell gsutil -m cp gs://minikube-builds/master/windows_cleanup_and_reboot.ps1 C:\jenkins; C:\jenkins\windows_cleanup_and_reboot.ps1"
|
||||||
|
|
Loading…
Reference in New Issue