From 224c0cc34f154c562dfac323bea96738101df07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Tue, 23 Jun 2026 16:19:48 +0200 Subject: [PATCH] Use a shallow git clone on Jenkins when possible for main build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit there are currently issues with disk space available on the Jenkins nodes. Camel is one of the most consuming one. Each of its workspace for Camel core is taking 4.4G, it includes 1.4G for the .git folder. Using a shallow clone should reduce the 1.4G to 63M and gain few minutes to the build too. Co-authored-by: IBM Bob IDE 1.0.3 Signed-off-by: Aurélien Pupier --- Jenkinsfile | 19 ++++++++++++++++++- Jenkinsfile.jdk26 | 9 ++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 559ee7d5678c7..ee19c59adbb08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -133,7 +133,24 @@ pipeline { steps { cleanWs() sh 'rm -rvf /home/jenkins/.m2/repository/org/apache/camel' - checkout scm + script { + // Use full clone for JDK 21 on ubuntu-avx (needed for Sonar analysis) + // Use shallow clone for all other combinations + if ("${PLATFORM}" == "ubuntu-avx" && "${JDK_NAME}" == "jdk_21_latest") { + echo "Using full clone for ${PLATFORM}-${JDK_NAME} (required for code coverage and Sonar)" + checkout scm + } else { + echo "Using shallow clone for ${PLATFORM}-${JDK_NAME}" + checkout([ + $class: 'GitSCM', + branches: scm.branches, + extensions: [ + [$class: 'CloneOption', depth: 1, noTags: true, shallow: true] + ], + userRemoteConfigs: scm.userRemoteConfigs + ]) + } + } } } diff --git a/Jenkinsfile.jdk26 b/Jenkinsfile.jdk26 index c1eebb908eadf..36b23478cb074 100644 --- a/Jenkinsfile.jdk26 +++ b/Jenkinsfile.jdk26 @@ -96,7 +96,14 @@ pipeline { steps { cleanWs() sh 'rm -rvf /home/jenkins/.m2/repository/org/apache/camel' - checkout scm + checkout([ + $class: 'GitSCM', + branches: scm.branches, + extensions: [ + [$class: 'CloneOption', depth: 1, noTags: true, shallow: true] + ], + userRemoteConfigs: scm.userRemoteConfigs + ]) } }