From 1807cd5499feeaf750aa4a4143052e27a5e9d639 Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Fri, 3 Nov 2023 16:08:38 +0100 Subject: [PATCH] kie-issues#599: set projectKey for sonarcloud (#3274) Co-authored-by: jstastny-cz --- .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 232a27175e1..06831ac5f52 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -15,6 +15,7 @@ pipeline { BUILDCHAIN_PROJECT = 'apache/incubator-kie-kogito-runtimes' ENABLE_SONARCLOUD = 'false' + SONAR_PROJECT_KEY = 'apache_incubator-kie-kogito-runtimes' KOGITO_RUNTIMES_BUILD_MVN_OPTS = '-Dvalidate-formatting -Prun-code-coverage' } stages { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index abeca6d80ef..d8e97121b54 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -99,9 +99,17 @@ Utils.isMainBranch(this) && KogitoJobTemplate.createPullRequestMultibranchPipeli createSetupBranchJob() // Nightly jobs +Closure setupSonarProjectKeyEnv = { Closure paramsGetter -> + return { script -> + def jobParams = paramsGetter(script) + jobParams.env.put('SONAR_PROJECT_KEY', 'apache_incubator-kie-kogito-runtimes') + return jobParams + } +} + Closure nightlyJobParamsGetter = isMainStream() ? JobParamsUtils.DEFAULT_PARAMS_GETTER : setup4AMCronTriggerJobParamsGetter KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true) -setupSpecificBuildChainNightlyJob('sonarcloud', nightlyJobParamsGetter) +setupSpecificBuildChainNightlyJob('sonarcloud', setupSonarProjectKeyEnv(nightlyJobParamsGetter)) setupSpecificBuildChainNightlyJob('native', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-main', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-branch', nightlyJobParamsGetter)