Skip to content

Commit

Permalink
Wrap deleteDir() in try/catch (#93)
Browse files Browse the repository at this point in the history
This sometimes fails, causing the entire build step to fail. This
should hopefully provide more information as to why its failing,
as well as also allow the build to succeed.
  • Loading branch information
jprestwo authored Feb 7, 2025
1 parent 119f369 commit 235c0a9
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ pipeline {
} finally {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand Down Expand Up @@ -234,7 +238,11 @@ pipeline {
artifacts: "$debian_dir/rules*, $debian_dir/control*, $debian_dir/Dockerfile*", allowEmptyArchive: true)
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand All @@ -255,7 +263,7 @@ pipeline {
docker.withRegistry(params.docker_registry, docker_credentials) { bundle_image.pull() }
}
bundle_image.inside("-v $HOME/tailor/ccache:/ccache -e CCACHE_DIR=/ccache") {
// Invoke the Jenkins Job Cacher Plugin via the cache method.
// Invoke the Jenkins Job Cacher Plugin via the cache method.
// Set the max cache size to 4GB, as S3 only allows a 5GB max upload at once
cache(maxCacheSize: 4000, caches: [
arbitraryFileCache(path: '${HOME}/tailor/ccache', cacheName: recipe_label)
Expand All @@ -275,7 +283,11 @@ pipeline {
// archiveArtifacts(artifacts: "*.deb", allowEmptyArchive: true)
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand Down Expand Up @@ -313,7 +325,11 @@ pipeline {
} finally {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand Down

0 comments on commit 235c0a9

Please sign in to comment.