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

drazzib pushed a commit to branch GORA-675
in repository https://gitbox.apache.org/repos/asf/gora.git

commit aa1f8f3c5789cb6293a6be4e7a4d97d69df1fa33
Author: Damien Raude-Morvan <damien.raude-mor...@verteego.com>
AuthorDate: Mon Apr 19 22:04:50 2021 +0200

    Jenkinsfile: include Code Quali
---
 Jenkinsfile | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9c8bd3f..f4211b5 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -62,6 +62,9 @@ pipeline {
         // --show-version Display version information WITHOUT stopping build
         // --no-transfer-progress Do not display transfer progress when 
downloading or uploading
         MAVEN_CLI_OPTS = "--batch-mode --errors --fail-at-end --show-version 
--no-transfer-progress"
+        // https://cwiki.apache.org/confluence/display/INFRA/SonarQube+Analysis
+        // 
https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-maven/
+        SONARCLOUD_PARAMS = "-Dsonar.host.url=https://sonarcloud.io 
-Dsonar.organization=apache -Dsonar.projectKey=apache_gora"
     }
 
     stages {
@@ -100,5 +103,16 @@ pipeline {
                 sh "mvn $MAVEN_CLI_OPTS --activate-profiles release 
-DskipTests deploy"
             }
         }
+
+        stage('Code Quality') {
+            steps {
+                echo 'Checking Code Quality on SonarCloud'
+                def sonarcloudParams = "${SONARCLOUD_PARAMS} 
-Dsonar.branch.name=${BRANCH_NAME}"
+                // 'drazzib-sonarcloud-token' needs to be defined for this job 
and contains the user token
+                withCredentials([string(credentialsId: 
'drazzib-sonarcloud-token', variable: 'SONAR_TOKEN')]) {
+                    sh "mvn sonar:sonar ${sonarcloudParams}"
+                }
+            }
+        }
     }
 }

Reply via email to