This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new c6d11827382d chore(ci): Jenkins pipeline refactoring
c6d11827382d is described below
commit c6d11827382d83370bfb2a3f7e09aef444bd697b
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Tue Jan 20 10:02:00 2026 +0100
chore(ci): Jenkins pipeline refactoring
* We can join the build and test phase to avoid double the time of the
compilation
* Make it more clear when executing the sonar profile
---
Jenkinsfile | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 462c92ce71a1..1f735db94b1f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -131,35 +131,25 @@ pipeline {
}
}
- stage('Build') {
+ stage('Build and test') {
steps {
- echo "Do Build for ${PLATFORM}-${JDK_NAME}"
+ echo "Do Build and test for
${PLATFORM}-${JDK_NAME}"
sh 'java -version'
- sh "./mvnw -U $MAVEN_PARAMS
-Dskip.camel.maven.plugin.tests -Darchetype.test.skip -DskipTests clean install"
- }
- }
-
- stage('Test and Quality') {
- steps {
- echo "Do Test for ${PLATFORM}-${JDK_NAME}"
timeout(unit: 'HOURS', time: 7) {
script {
if ("${PLATFORM}" == "ubuntu-avx") {
if ("${JDK_NAME}" == "jdk_21_latest") {
- sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS_UBUNTU -Darchetype.test.skip
-Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true verify
-Dcamel.threads.virtual.enabled=${params.VIRTUAL_THREAD}"
- echo "Code quality review disabled
for ${PLATFORM} with JDK ${JDK_NAME}"
+ // Enable virtual threads
+ sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS_UBUNTU -Darchetype.test.skip
-Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true install
-Dcamel.threads.virtual.enabled=${params.VIRTUAL_THREAD}"
} else if ("${JDK_NAME}" ==
"jdk_17_latest") {
-
withCredentials([string(credentialsId: 'apache-camel-core', variable:
'SONAR_TOKEN')]) {
- echo "Code quality review
ENABLED for ${PLATFORM} with ${JDK_NAME}"
- sh "./mvnw $MAVEN_PARAMS
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.java.experimental.batchModeSizeInKB=2048 -Dsonar.organization=apache
-Dsonar.projectKey=apache_camel -Dsonar.branch.name=$BRANCH_NAME clean verify
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage"
- }
+ // Enable coverage required later
by Sonar check
+ sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS -Darchetype.test.skip -Dmaven.test.failure.ignore=true
-Dcheckstyle.skip=true install -Pcoverage"
} else {
- sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS -Darchetype.test.skip -Dmaven.test.failure.ignore=true
-Dcheckstyle.skip=true verify"
- echo "Code quality review disabled
for ${PLATFORM} with JDK ${JDK_NAME}"
+ sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS -Darchetype.test.skip -Dmaven.test.failure.ignore=true
-Dcheckstyle.skip=true install"
}
} else {
// Skip the test case execution of
modules which are either not supported on ppc64le or vendor images are not
available for ppc64le.
- sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS $MAVEN_TEST_PARAMS_ALT_ARCHS -Darchetype.test.skip
-Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true verify -pl '!docs'"
+ sh "./mvnw $MAVEN_PARAMS
$MAVEN_TEST_PARAMS $MAVEN_TEST_PARAMS_ALT_ARCHS -Darchetype.test.skip
-Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true install -pl '!docs'"
echo "Code quality review disabled for
${PLATFORM} with JDK ${JDK_NAME}"
}
}
@@ -172,6 +162,23 @@ pipeline {
}
}
}
+
+ stage('Static code analysis') {
+ steps {
+ script {
+ echo "Do Static code analysis for
${PLATFORM}-${JDK_NAME}"
+ // We only execute this on the main
PLATFORM/JDK target
+ if ("${PLATFORM}" == "ubuntu-avx" &&
"${JDK_NAME}" == "jdk_17_latest") {
+ withCredentials([string(credentialsId:
'apache-camel-core', variable: 'SONAR_TOKEN')]) {
+ echo "Code quality review ENABLED for
${PLATFORM} with ${JDK_NAME}"
+ sh "./mvnw $MAVEN_PARAMS
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.java.experimental.batchModeSizeInKB=2048 -Dsonar.organization=apache
-Dsonar.projectKey=apache_camel -Dsonar.branch.name=$BRANCH_NAME
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar"
+ }
+ } else {
+ echo "Code quality review DISABLED for
${PLATFORM} with ${JDK_NAME}"
+ }
+ }
+ }
+ }
}
post {
always {