From 115887bd8d02d45892422f4b78b29cca5bf21e4a Mon Sep 17 00:00:00 2001 From: Matthieu Kermagoret Date: Mon, 10 Dec 2018 11:38:29 +0100 Subject: [PATCH] add SonarQube analysis to the Jenkinsfile (#1264) --- Jenkinsfile | 5 +++++ sonar-project.properties | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 sonar-project.properties diff --git a/Jenkinsfile b/Jenkinsfile index 0e5297c49..769994fd1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,11 @@ stage('Source') { source = readProperties file: 'source.properties' env.VERSION = "${source.VERSION}" env.RELEASE = "${source.RELEASE}" + if (env.BRANCH_NAME == 'master') { + withSonarQubeEnv('SonarQube') { + sh './centreon-build/jobs/plugins/plugins-analysis.sh' + } + } } } diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..922afdb35 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=centreon-plugins +sonar.projectName=Centreon Plugins +sonar.sources=.