From f693450455ef4e363866c4fff13a5cb608868f27 Mon Sep 17 00:00:00 2001 From: RebeccaNod1 Date: Thu, 14 Aug 2025 00:42:28 -0500 Subject: [PATCH] Add workspace cleanup stage to Jenkins pipeline - Added 'Clean Workspace' stage to remove all processed_*.lsl files before preprocessing - Fixed documentation generation to only process original source files - This will clean up the hundreds of recursive processed files from Jenkins workspace - Pipeline now starts with a clean slate on each build --- Jenkinsfile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 46367a2..6967139 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,6 +37,25 @@ pipeline { } } + stage('Clean Workspace') { + when { + anyOf { + environment name: 'GIT_BRANCH', value: 'origin/main' + environment name: 'GIT_BRANCH', value: 'origin/develop' + environment name: 'GIT_BRANCH', value: 'main' + environment name: 'GIT_BRANCH', value: 'develop' + } + } + steps { + echo "๐Ÿงน Cleaning up processed files from previous builds..." + sh ''' + # Remove any processed files from previous builds + rm -f processed_*.lsl + echo "Workspace cleaned of processed files" + ''' + } + } + stage('Preprocess Scripts') { when { anyOf { @@ -115,14 +134,14 @@ pipeline { steps { echo "๐Ÿ“š Updating project documentation..." sh ''' - # Generate function list from LSL files + # Generate function list from original LSL files only echo "# Project Functions" > FUNCTIONS.md echo "" >> FUNCTIONS.md echo "Auto-generated list of functions in this project:" >> FUNCTIONS.md echo "" >> FUNCTIONS.md for file in *.lsl; do - if [ -f "$file" ]; then + if [ -f "$file" ] && [[ ! "$file" =~ ^processed_ ]]; then echo "## $file" >> FUNCTIONS.md echo "" >> FUNCTIONS.md grep -n "^[a-zA-Z_][a-zA-Z0-9_]*(" "$file" | head -20 >> FUNCTIONS.md || true