Merge pull request #16171 from spowelljr/restartIfDockerFails

CI: restart Windows if Docker fails to start
pull/16177/head
Medya Ghazizadeh 2023-03-27 16:31:26 -07:00 committed by GitHub
commit bae9c4e3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -44,12 +44,20 @@ gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_cleanup_
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_cleanup_cron.ps1 out/
./out/windows_cleanup_cron.ps1
# Grab all the scripts we'll need for integration tests
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_integration_setup.ps1 out/
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_integration_teardown.ps1 out/
# check for Docker CLI
docker --help
if ($lastexitcode -gt 0) {
echo "Docker CLI not found, exiting."
$json = "{`"state`": `"failure`", `"description`": `"Jenkins: Docker CLI not found`", `"target_url`": `"https://storage.googleapis.com/$gcs_bucket/$env:JOB_NAME.txt`", `"context`": `"$env:JOB_NAME`"}"
Write-GithubStatus -JsonBody $json
./out/windows_integration_teardown.ps1
Exit $lastexitcode
}
@ -61,6 +69,7 @@ if ($driver -eq "docker") {
echo "Docker failed to start, exiting."
$json = "{`"state`": `"failure`", `"description`": `"Jenkins: docker failed to start`", `"target_url`": `"https://storage.googleapis.com/$gcs_bucket/$env:JOB_NAME.txt`", `"context`": `"$env:JOB_NAME`"}"
Write-GithubStatus -JsonBody $json
./out/windows_integration_teardown.ps1
Exit $lastexitcode
}
docker system prune -a --volumes -f
@ -78,13 +87,6 @@ if (Test-Path "C:\Go") {
Remove-Item "C:\Go" -Recurse -Force
}
# Grab all the scripts we'll need for integration tests
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_integration_setup.ps1 out/
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_integration_teardown.ps1 out/
./out/windows_integration_setup.ps1
$started=Get-Date -UFormat %s