This is an automated email from the ASF dual-hosted git repository.

Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 2048cfb9c7a Add optional workspace cleanup stage to Jenkinsfile (#1987)
2048cfb9c7a is described below

commit 2048cfb9c7aea15ec21b63f044d9a6cfeff743ee
Author: Aditya Kumar <[email protected]>
AuthorDate: Fri Sep 18 16:53:37 2026 +0530

    Add optional workspace cleanup stage to Jenkinsfile (#1987)
    
    * Fix broken Javadocs badge link in README
    Correct the Javadocs badge/link mismatch: the image referenced
    org.apache.camel/apache-camel while the link pointed to
    org.apache.camel/camel-core, and the URL used http instead of https.
    Align both to org.apache.camel/camel-core over https.
    
    * Fix stale Javadocs badge link in README
    
    Replace org.apache.camel/camel-core Javadoc link/badge, which was
    stuck at an old 3.0.0 release, with org.apache.camel/camel-api,
    which correctly resolves to the latest release. Also switch the
    badge image URL to https.
    
    * Add optional clean-workspace stage before build
    
    Introduce a CLEAN build parameter (default: true) and a new
    Clean workspace stage that runs cleanWs() prior to Build & Deploy.
    This ensures builds start from a pristine workspace by default while
    allowing it to be skipped via the CLEAN parameter when needed (e.g.
    for faster iterative debugging).
    
    Cleanup failures are caught and logged rather than failing the
    pipeline, since a failed cleanup should not block the build itself.
    
    * Add optional clean-workspace stage
    
    Add CLEAN param (default: true), git clean -fdx pre-build stage,
    and post-success cleanWs(). Matches Jenkinsfile.sb pattern.
---
 Jenkinsfile.sb.deploy | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile.sb.deploy b/Jenkinsfile.sb.deploy
index 5aa77a5da27..30f0902ee98 100644
--- a/Jenkinsfile.sb.deploy
+++ b/Jenkinsfile.sb.deploy
@@ -50,8 +50,21 @@ pipeline {
         disableConcurrentBuilds()
     }
 
+    parameters {
+        booleanParam(name: 'CLEAN', defaultValue: true, description: 'Perform 
the build in clean workspace')
+    }
+
     stages {
 
+        stage('Clean workspace') {
+            when {
+                expression { params.CLEAN }
+            }
+            steps {
+                sh 'git clean -fdx'
+            }
+        }
+
         stage('Build & Deploy') {
             when {
                 anyOf {
@@ -72,6 +85,15 @@ pipeline {
                 body: '${DEFAULT_CONTENT}',
                 recipientProviders: [[$class: 'DevelopersRecipientProvider']]
             )
+            cleanWs(
+                cleanWhenNotBuilt: false,
+                cleanWhenUnstable: false,
+                cleanWhenFailure: false,
+                cleanWhenAborted: false,
+                cleanWhenSuccess: true,
+                deleteDirs: true,
+                disableDeferredWipeout: true,
+                notFailBuild: true)
         }
     }
-}
+}
\ No newline at end of file

Reply via email to