From cfe7a242c9927d60bf24527df0bf504cce2984ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gyulai=20D=C3=A1niel?= Date: Thu, 5 Nov 2020 09:22:38 -0500 Subject: [PATCH] Added try/finally block in Jenkinsfile --- Jenkinsfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0419cdf..2e025ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,6 +47,7 @@ spec: ''') { node(POD_LABEL) { + try { stage('Git') { git url: 'https://gyulai.cloud/git/bme/covidok-backend.git', credentialsId: '1b1c30a0-590d-41d4-b775-bdb90e837bc8' @@ -87,13 +88,10 @@ spec: } } } - post { - always { - node(POD_LABEL) { - container('helm') { - sh '/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/cleanup.sh' - } - } + finally { + container('helm') { + sh '/home/jenkins/agent/workspace/gitea-bme_covidok-backend_master/ci/cleanup.sh' } } + } }