Skip to content

Commit

Permalink
Merge pull request #16186 from spowelljr/runDockerAlways
Browse files Browse the repository at this point in the history
CI: Always require Docker to be running
  • Loading branch information
medyagh authored Mar 29, 2023
2 parents e9dca8e + 5741979 commit 87f0bd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
30 changes: 9 additions & 21 deletions hack/jenkins/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,17 @@ 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
# Make sure Docker is up and running
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/setup_docker_desktop_windows.ps1 out/
./out/setup_docker_desktop_windows.ps1
If ($lastexitcode -gt 0) {
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
}

if ($driver -eq "docker") {
# Make sure Docker is up and running
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/setup_docker_desktop_windows.ps1 out/
./out/setup_docker_desktop_windows.ps1
If ($lastexitcode -gt 0) {
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
Exit $lastexitcode
}
docker system prune -a --volumes -f

# install/update Go if required
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/installers/check_install_golang.ps1 out/
Expand Down
2 changes: 1 addition & 1 deletion hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if [ "$(uname)" = "Darwin" ]; then
export PATH=$PATH:/opt/homebrew/bin
fi

if [ "$DRIVER" = "docker" ] && ! bash setup_docker_desktop_macos.sh; then
if ! bash setup_docker_desktop_macos.sh; then
retry_github_status "${COMMIT}" "${JOB_NAME}" "failure" "${access_token}" "${public_log_url}" "Jenkins: docker failed to start"
exit 1
fi
Expand Down

0 comments on commit 87f0bd6

Please sign in to comment.