From d266b41c6d7eaebc5ee01cf592ab04c7226f0d38 Mon Sep 17 00:00:00 2001 From: lprimak Date: Tue, 23 Jun 2026 15:01:34 -0500 Subject: [PATCH] chore(jenkins): clean up custom workspace directories --- .jenkins.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.jenkins.groovy b/.jenkins.groovy index 7a0a8df9d6..f32d7f9555 100644 --- a/.jenkins.groovy +++ b/.jenkins.groovy @@ -202,6 +202,16 @@ Check console output at "${env.JOB_NAME} [${env.BRANC // (in this case we probably don't have to do any post-build analysis) cleanBeforeCheckout() script { + // remove MatrixCheckout directories older than 30 days to save disk space + sh ''' + set -eu + base_dir="../../../.." + if [ -d "$base_dir" ]; then + find "$base_dir" -name MatrixCheckout -mindepth 3 -maxdepth 3 -type d -mtime +30 -exec rm -rf {} + + fi + ''' + + // If this build was successful, and the previous build was not successful, send a "back to normal" email. if (deployableBranch && (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) { emailext(