Add complete workspace cleanup before checkout
- Now clears entire workspace except .git directory before checkout - Ensures absolutely clean state for every build - Uses safe find command with error suppression - Guarantees no leftover files from previous builds can interfere
This commit is contained in:
parent
6696ec9ca1
commit
152d638b3f
1 changed files with 11 additions and 11 deletions
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
|
|
@ -13,6 +13,17 @@ pipeline {
|
|||
}
|
||||
|
||||
stages {
|
||||
stage('Clean Workspace') {
|
||||
steps {
|
||||
echo "🧹 Cleaning entire workspace before checkout..."
|
||||
sh '''
|
||||
# Remove everything except .git directory
|
||||
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} + 2>/dev/null || true
|
||||
echo "Workspace completely cleaned"
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
echo "🔍 Checking out LSL project: ${PROJECT_NAME}"
|
||||
|
|
@ -20,17 +31,6 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Clean Workspace') {
|
||||
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('LSL Validation') {
|
||||
steps {
|
||||
echo "🔧 Validating LSL syntax..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue