From 883095383c97982f8ea241630cc6b76453d7bf8e Mon Sep 17 00:00:00 2001 From: Francois Papon Date: Sun, 20 Sep 2020 18:36:52 +0200 Subject: [PATCH] Add Sonarqube quality check --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fc7e01f36a..1d18c8522e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,6 +18,7 @@ * limitations under the License. * */ +def sonarcloudParams="-Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_shiro" pipeline { @@ -89,6 +90,15 @@ pipeline { } } + stage('Code Quality') { + steps { + echo 'Checking Code Quality on SonarCloud' + withCredentials([string(credentialsId: 'sonarcloud-key-apache-shiro', variable: 'SONAR_TOKEN')]) { + sh 'mvn sonar:sonar ${sonarcloudParams} -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}' + } + } + } + stage('Generate doc') { when { expression {