From d751f419de65c1f568fca393a4c24d4ab73b9ca2 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 19 Aug 2020 14:15:36 +0200 Subject: [PATCH] Jenkinsfile: Force the cleanup after stages are aborted Problem with the previous solution was that Cleanup stage was not executed when previous stages failed. We fix this by adding a post section that executes always after the Aarch64 build completed, no matter if it has failed, succeeded or been aborted. Signed-off-by: Sebastien Boeuf --- Jenkinsfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e8dac498a..5c5e9e483 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,6 +84,12 @@ pipeline{ } } } + post { + always { + sh "sudo chown -R jenkins.jenkins ${WORKSPACE}" + deleteDir() + } + } } stage ('Worker build (musl)') { agent { node { label 'bionic' } } @@ -110,13 +116,6 @@ pipeline{ } } } - stage ('Cleanup') { - agent { node { label 'bionic-arm64' } } - steps { - sh "sudo chown -R jenkins.jenkins ${WORKSPACE}" - deleteDir() - } - } } post { regression {