jenkins: retry docker_build (#30629)

* retry docker build

* retry docker build

* retry docker build

* does this work nicely?

* docker fail!

* Revert "docker fail!"

This reverts commit ab227a1ea3.
This commit is contained in:
Justin Newberry 2023-12-12 18:12:19 -08:00 committed by GitHub
parent 93cd19e3a5
commit 02373fcb05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

10
Jenkinsfile vendored
View File

@ -1,8 +1,7 @@
def retryWithDelay(int maxRetries, int delay, Closure body) {
for (int i = 0; i < maxRetries; i++) {
try {
body()
return
return body()
} catch (Exception e) {
sleep(delay)
}
@ -101,7 +100,12 @@ def pcStage(String stageName, Closure body) {
checkout scm
def dockerArgs = "--user=batman -v /tmp/comma_download_cache:/tmp/comma_download_cache -v /tmp/scons_cache:/tmp/scons_cache -e PYTHONPATH=${env.WORKSPACE}";
docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .").inside(dockerArgs) {
def openpilot_base = retryWithDelay (3, 15) {
return docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .")
}
openpilot_base.inside(dockerArgs) {
timeout(time: 20, unit: 'MINUTES') {
try {
retryWithDelay (3, 15) {