Skip to content

Commit

Permalink
Wrap deleteDir() in try/catch
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 committed Sep 17, 2024
1 parent 9e0d5da commit 372ec40
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ pipeline {
}
post {
cleanup {
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}
}
Expand Down Expand Up @@ -107,7 +111,11 @@ pipeline {
cleanup {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}
}
Expand Down Expand Up @@ -156,7 +164,11 @@ pipeline {
cleanup {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}
}
Expand Down Expand Up @@ -185,7 +197,11 @@ pipeline {
} finally {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand Down Expand Up @@ -234,7 +250,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 +275,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.
cache(caches: [
arbitraryFileCache(path: '${HOME}/tailor/ccache', cacheName: recipe_label)
]) {
Expand All @@ -274,7 +294,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 @@ -312,7 +336,11 @@ pipeline {
} finally {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
try {
deleteDir()
} catch (e) {
println e
}
}
}}]
}
Expand Down

0 comments on commit 372ec40

Please sign in to comment.