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

tzimanyi pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git


The following commit(s) were added to refs/heads/main by this push:
     new 0811e198 kie-issues#667: fix cleanup and settingsXml handling (#1113)
0811e198 is described below

commit 0811e1984c2d11dc4f7e77b3d395767f79c65eb0
Author: Jan Stastny <[email protected]>
AuthorDate: Thu Nov 2 15:36:11 2023 +0100

    kie-issues#667: fix cleanup and settingsXml handling (#1113)
    
    * kie-issues#667: fix cleanup and settingsXml handling
    
    * adjust also sonarcloud in buildchain
    
    * override sonar.organization for the time being
    
    ---------
    
    Co-authored-by: jstastny-cz <[email protected]>
---
 .ci/jenkins/Jenkinsfile.nightly.quarkus-platform       |  4 ++--
 .ci/jenkins/Jenkinsfile.release                        |  2 ++
 .ci/jenkins/Jenkinsfile.release.cloud                  |  2 ++
 dsl/scripts/pr_check.groovy                            | 11 ++++++++++-
 dsl/seed/jenkinsfiles/Jenkinsfile.buildchain           | 18 ++++++++++--------
 dsl/seed/jenkinsfiles/Jenkinsfile.remove.branches      |  2 +-
 dsl/seed/jenkinsfiles/Jenkinsfile.seed.main            |  2 +-
 dsl/seed/jenkinsfiles/Jenkinsfile.seed.trigger         |  2 +-
 .../jenkinsfiles/Jenkinsfile.tools.toggle-triggers     |  2 +-
 .../jenkinsfiles/Jenkinsfile.update-quarkus-platform   |  2 +-
 10 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.nightly.quarkus-platform 
b/.ci/jenkins/Jenkinsfile.nightly.quarkus-platform
index 0600cd4e..0654758e 100644
--- a/.ci/jenkins/Jenkinsfile.nightly.quarkus-platform
+++ b/.ci/jenkins/Jenkinsfile.nightly.quarkus-platform
@@ -28,7 +28,7 @@ pipeline {
         stage('Initialize') {
             steps {
                 script {
-                    cleanWs()
+                    cleanWs(disableDeferredWipeout: true)
                     sh 'printenv'
 
                     if (params.DISPLAY_NAME) {
@@ -175,7 +175,7 @@ pipeline {
     // Tests of platform should be done in a separate job
     }
     post {
-        always {
+        cleanup {
             cleanWs()
         }
         unsuccessful {
diff --git a/.ci/jenkins/Jenkinsfile.release b/.ci/jenkins/Jenkinsfile.release
index 2eccc43d..64f9f551 100644
--- a/.ci/jenkins/Jenkinsfile.release
+++ b/.ci/jenkins/Jenkinsfile.release
@@ -206,6 +206,8 @@ pipeline {
             script {
                 saveReleaseProperties()
             }
+        }
+        cleanup {
             cleanWs()
         }
         success {
diff --git a/.ci/jenkins/Jenkinsfile.release.cloud 
b/.ci/jenkins/Jenkinsfile.release.cloud
index 7019f149..26883e2b 100644
--- a/.ci/jenkins/Jenkinsfile.release.cloud
+++ b/.ci/jenkins/Jenkinsfile.release.cloud
@@ -273,6 +273,8 @@ pipeline {
             script {
                 saveReleaseProperties()
             }
+        }
+        cleanup {
             cleanWs()
         }
         success {
diff --git a/dsl/scripts/pr_check.groovy b/dsl/scripts/pr_check.groovy
index 8cbb7b55..bc7475ff 100644
--- a/dsl/scripts/pr_check.groovy
+++ b/dsl/scripts/pr_check.groovy
@@ -85,7 +85,16 @@ void launchStages() {
     stage('Sonar analysis') {
         if (isEnableSonarCloudAnalysis()) {
             dir(getProjectFolder()) {
-                    maven.runMavenWithSettingsSonar(settingsXmlId, "-e -nsu 
validate -Psonarcloud-analysis -Denforcer.skip=true 
${env.SONARCLOUD_ANALYSIS_MVN_OPTS ?: ''}", 'SONARCLOUD_TOKEN', 
'sonar_analysis.maven.log')
+                configFileProvider([configFile(fileId: 'kie-pr-settings', 
variable: 'MAVEN_SETTINGS_FILE')]) {
+                    withCredentials([string(credentialsId: 'SONARCLOUD_TOKEN', 
variable: 'TOKEN')]) {
+                        new MavenCommand(this)
+                                .withProperty('sonar.login', "${TOKEN}")
+                                .withProperty('sonar.organization', 'apache') 
// override what's in pom.xml for now
+                                .withLogFileName('sonar_analysis.maven.log')
+                                .withSettingsXmlFile(MAVEN_SETTINGS_FILE)
+                                .run("-e -nsu validate -Psonarcloud-analysis 
-Denforcer.skip=true ${env.SONARCLOUD_ANALYSIS_MVN_OPTS ?: ''}")
+                    }
+                }
             }
         }
     }
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain 
b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
index 9318bcc1..f60c700e 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
@@ -139,7 +139,16 @@ pipeline {
                     steps {
                         script {
                             dir(getProjectFolder()) {
-                                maven.runMavenWithSettingsSonar(settingsXmlId, 
"-e -nsu validate -Psonarcloud-analysis -Denforcer.skip=true 
${env.SONARCLOUD_ANALYSIS_MVN_OPTS ?: ''}", 'SONARCLOUD_TOKEN', 
'sonar_analysis.maven.log')
+                                configFileProvider([configFile(fileId: 
settingsXmlId, variable: 'MAVEN_SETTINGS_FILE')]) {
+                                    withCredentials([string(credentialsId: 
'SONARCLOUD_TOKEN', variable: 'TOKEN')]) {
+                                        new MavenCommand(this)
+                                            .withProperty('sonar.login', 
"${TOKEN}")
+                                            
.withProperty('sonar.organization', 'apache') // override what's in pom.xml for 
now
+                                            
.withLogFileName('sonar_analysis.maven.log')
+                                            
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
+                                            .run("-e -nsu validate 
-Psonarcloud-analysis -Denforcer.skip=true ${env.SONARCLOUD_ANALYSIS_MVN_OPTS 
?: ''}")
+                                    }
+                                }
                             }
                         }
                     }
@@ -187,13 +196,6 @@ pipeline {
         cleanup {
             cleanWs()
         }
-        // cleanup {
-        //     script {
-        //         // Clean also docker in case of usage of testcontainers lib
-        //         util.cleanNode('docker')
-        //         sh 'rm -rf /tmp/quarkus'
-        //     }
-        // }
     }
 }
 
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.remove.branches 
b/dsl/seed/jenkinsfiles/Jenkinsfile.remove.branches
index cd43592c..ffedc929 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.remove.branches
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.remove.branches
@@ -23,7 +23,7 @@ pipeline {
     stages{
         stage('CleanWorkspace') {
             steps {
-                cleanWs()
+                cleanWs(disableDeferredWipeout: true)
             }
         }
         stage('Initialize') {
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.main 
b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.main
index 98b7ead0..30af7719 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.main
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.main
@@ -167,7 +167,7 @@ pipeline {
     }
 }
     post {
-        always {
+        cleanup {
             cleanWs()
         }
         unsuccessful {
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.trigger 
b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.trigger
index 4fe35ac7..ffd3229b 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.trigger
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.trigger
@@ -33,7 +33,7 @@ pipeline {
                 }
             }
             post {
-                always {
+                cleanup {
                     cleanWs()
                 }
             }
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.tools.toggle-triggers 
b/dsl/seed/jenkinsfiles/Jenkinsfile.tools.toggle-triggers
index d63cd573..1e60b137 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.tools.toggle-triggers
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.tools.toggle-triggers
@@ -22,7 +22,7 @@ pipeline {
     stages {
         stage('CleanWorkspace') {
             steps {
-                cleanWs()
+                cleanWs(disableDeferredWipeout: true)
             }
         }
         stage('Initialize') {
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.update-quarkus-platform 
b/dsl/seed/jenkinsfiles/Jenkinsfile.update-quarkus-platform
index 8843ea7a..967838b0 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.update-quarkus-platform
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.update-quarkus-platform
@@ -26,7 +26,7 @@ pipeline {
     stages{
         stage('CleanWorkspace') {
             steps {
-                cleanWs()
+                cleanWs(disableDeferredWipeout: true)
             }
         }
                stage('Initialize') {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to