From 1fc9a77e3cf42f30b581e2942c2f35896baef276 Mon Sep 17 00:00:00 2001 From: jstastny-cz Date: Fri, 3 Nov 2023 13:02:34 +0100 Subject: [PATCH] kie-issues_599: set projectKey for sonarcloud --- .ci/jenkins/Jenkinsfile | 1 + .ci/jenkins/dsl/jobs.groovy | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 2488ec70106..dc43651187b 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -17,6 +17,7 @@ pipeline { BUILDCHAIN_CONFIG_FILE_PATH = '.ci/buildchain-config-pr-cdb.yaml' ENABLE_SONARCLOUD = 'false' + SONAR_PROJECT_KEY = 'apache_incubator-kie-drools' DROOLS_BUILD_MVN_OPTS = '-Prun-code-coverage' } stages { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 2ac07e91161..b36c69c13a9 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -195,10 +195,18 @@ Closure setup3AMCronTriggerJobParamsGetter = { script -> return jobParams } +Closure setupSonarProjectKeyEnv = { Closure paramsGetter -> + return { script -> + def jobParams = paramsGetter(script) + jobParams.env.put('SONAR_PROJECT_KEY', 'apache_incubator-kie-drools') + return jobParams + } +} + Closure nightlyJobParamsGetter = isMainStream() ? JobParamsUtils.DEFAULT_PARAMS_GETTER : setup3AMCronTriggerJobParamsGetter KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true) setupSpecificBuildChainNightlyJob('native', nightlyJobParamsGetter) -setupSpecificBuildChainNightlyJob('sonarcloud', nightlyJobParamsGetter) +setupSpecificBuildChainNightlyJob('sonarcloud', setupSonarProjectKeyEnv(nightlyJobParamsGetter)) setupQuarkusIntegrationJob('quarkus-main', nightlyJobParamsGetter) setupQuarkusIntegrationJob('quarkus-branch', nightlyJobParamsGetter) setupQuarkusIntegrationJob('quarkus-lts', nightlyJobParamsGetter)