From 2f75e0baef46391f43c8c498b7a11fd47172e664 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 17 Sep 2024 10:13:18 -0700 Subject: [PATCH] Wrap deleteDir() in try/catch 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. --- Jenkinsfile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e7594d..ee6222a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -185,7 +185,11 @@ pipeline { } finally { library("tailor-meta@${params.tailor_meta}") cleanDocker() - deleteDir() + try { + deleteDir() + } catch (e) { + println e + } } }}] } @@ -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 + } } }}] } @@ -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. cache(caches: [ arbitraryFileCache(path: '${HOME}/tailor/ccache', cacheName: recipe_label) ]) { @@ -274,7 +282,11 @@ pipeline { // archiveArtifacts(artifacts: "*.deb", allowEmptyArchive: true) library("tailor-meta@${params.tailor_meta}") cleanDocker() - deleteDir() + try { + deleteDir() + } catch (e) { + println e + } } }}] } @@ -312,7 +324,11 @@ pipeline { } finally { library("tailor-meta@${params.tailor_meta}") cleanDocker() - deleteDir() + try { + deleteDir() + } catch (e) { + println e + } } }}] }