From 34c7deffd3c547359aa9449269131bc553a1d212 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 16 Oct 2020 20:54:15 +0200 Subject: [PATCH] Add SonarQube stage to Jenkins pipeline --- Jenkinsfile | 5 +++++ build.gradle | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index cb4582a2d..131b0604e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,4 +19,9 @@ node { stage('Publish artifacts') { sh "./gradlew publish" } + stage('SonarQube') { + withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) { + sh "./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN" + } + } } diff --git a/build.gradle b/build.gradle index 96157b442..66896e406 100755 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,10 @@ buildscript { } } +plugins { + id "org.sonarqube" version "3.0" +} + repositories { maven { url = "https://dvs1.progwml6.com/files/maven/" @@ -18,6 +22,14 @@ repositories { } } +sonarqube { + properties { + property "sonar.projectKey", "refinedmods_refinedstorage" + property "sonar.organization", "refinedmods" + property "sonar.host.url", "https://sonarcloud.io" + } +} + apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish'