From 35f34d25d160b1fb6abfa1e42da3fb8483312b26 Mon Sep 17 00:00:00 2001 From: Bartosz Cichocki Date: Tue, 3 Aug 2021 12:46:31 +0200 Subject: [PATCH] [EGD-7271] Fix cleanup in Jenkinsfile Fixing cleanup in Jenkinsfile and moving Clang checks before compilation --- Jenkinsfile | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 628b2ccf1251efd3f3ebb821ccf72a09d9eaf2aa..9cd1f9bf0a14a313671fd4490c186b629e633f5a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,7 @@ pipeline { agent { node { label 'jenkins-slave-ccache-ram' + customWorkspace "/home/jenkins/workspace/${JOB_NAME}/${BUILD_NUMBER}" } } options{ @@ -123,7 +124,7 @@ ccache --show-stats''' } steps { - echo "Build" + echo "Configure" sh '''#!/bin/bash -e echo "JOBS=${JOBS}" pushd "${WORKSPACE}" @@ -131,18 +132,10 @@ echo "./configure.sh pure linux Debug -G Ninja" ./configure.sh pure linux Debug -G Ninja -pushd build-purephone-linux-Debug -ninja -j ${JOBS} -popd - echo "./configure.sh bell linux Debug -G Ninja" ./configure.sh bell linux Debug -G Ninja -pushd build-bell-linux-Debug -ninja -j ${JOBS} -popd - popd''' echo "Clang Tidy check" /* requires compilation database - must be run after configuration */ @@ -150,6 +143,21 @@ popd''' pushd ${WORKSPACE} ./config/clang_check.sh popd''' + echo "Build" + sh '''#!/bin/bash -e +echo "JOBS=${JOBS}" +pushd "${WORKSPACE}" + +pushd build-purephone-linux-Debug +ninja -j ${JOBS} +popd + +pushd build-bell-linux-Debug +ninja -j ${JOBS} +popd + +popd''' + echo "Build Unit Tests" sh '''#!/bin/bash -e pushd "${WORKSPACE}" @@ -201,8 +209,15 @@ popd''' } } post { - always { - cleanWs() - } + cleanup { + deleteDir() + dir("${workspace}@tmp") { + deleteDir() + } + dir("${workspace}@script") { + deleteDir() + } + } } + }