From 07b6bc9641f629dc6d2fa572b73e3de46f529b7e Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Wed, 29 Sep 2021 10:54:25 +0200 Subject: [PATCH] jenkins: added cleaning workspace Signed-off-by: Marc Mattmueller --- Jenkinsfile_Common | 7 +++++++ Jenkinsfile_RamdiskImages | 3 +++ Jenkinsfile_mmcImages | 3 +++ Jenkinsfile_sdk | 3 +++ 4 files changed, 16 insertions(+) diff --git a/Jenkinsfile_Common b/Jenkinsfile_Common index 7c8ecb9..8c4385a 100644 --- a/Jenkinsfile_Common +++ b/Jenkinsfile_Common @@ -24,6 +24,13 @@ echo "loading common yocto build module..." // eg. extcode.build(...) +def cleanWorkspace() { + println "cleaning workspace..." + sh "find \"${WORKSPACE}/build-common/sstate-cache\" -name \"sstate*\" -atime +3 -delete" + sh "find \"${env.SHARED_BUILD}/tmp/work\" -name temp -type d -exec rm -rf {} +" +} + + def isRelease(versionParam) { if((versionParam == "") || (versionParam == "latest")) { return false diff --git a/Jenkinsfile_RamdiskImages b/Jenkinsfile_RamdiskImages index c07492b..f694c04 100644 --- a/Jenkinsfile_RamdiskImages +++ b/Jenkinsfile_RamdiskImages @@ -52,6 +52,9 @@ pipeline { env.ROOTDIR = pwd() yoctocommon = load "${env.ROOTDIR}/Jenkinsfile_Common" + // clean-up no longer needed packages + yoctocommon.cleanWorkspace() + // Prepare Build Environment env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}" yoctocommon.handleSubmodules("${params.RLS_VERSION}") diff --git a/Jenkinsfile_mmcImages b/Jenkinsfile_mmcImages index 74b8e70..a8f9348 100644 --- a/Jenkinsfile_mmcImages +++ b/Jenkinsfile_mmcImages @@ -55,6 +55,9 @@ pipeline { env.ROOTDIR = pwd() yoctocommon = load "${env.ROOTDIR}/Jenkinsfile_Common" + // clean-up no longer needed packages + yoctocommon.cleanWorkspace() + // Prepare Build Environment env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}" yoctocommon.handleSubmodules("${params.RLS_VERSION}") diff --git a/Jenkinsfile_sdk b/Jenkinsfile_sdk index f766f3c..7be5d5b 100644 --- a/Jenkinsfile_sdk +++ b/Jenkinsfile_sdk @@ -53,6 +53,9 @@ pipeline { env.ROOTDIR = pwd() yoctocommon = load "${env.ROOTDIR}/Jenkinsfile_Common" + // clean-up no longer needed packages + yoctocommon.cleanWorkspace() + // Prepare Build Environment env.YOCTO_DEPLOYS = "${env.SHARED_BUILD}/tmp/deploy/sdk" yoctocommon.handleSubmodules("${params.RLS_VERSION}")