From 8ea665e0b5470dd33dfccb65a5a326980d933a25 Mon Sep 17 00:00:00 2001 From: jstastny-cz Date: Fri, 3 Nov 2023 12:59:31 +0100 Subject: [PATCH] kie-issues_599: specify projectKey for sonar analysis --- .ci/jenkins/Jenkinsfile | 1 + .ci/jenkins/dsl/jobs.groovy | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 2defd41558..12df4ee154 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -16,6 +16,7 @@ pipeline { BUILDCHAIN_PROJECT = 'apache/incubator-kie-kogito-apps' ENABLE_SONARCLOUD = 'false' + SONAR_PROJECT_KEY = 'apache_incubator-kie-kogito-apps' KOGITO_APPS_BUILD_MVN_OPTS = '-Dvalidate-formatting -Prun-code-coverage' } stages { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 635d2f631a..5e55efe50d 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -118,15 +118,25 @@ Closure setup4AMCronTriggerJobParamsGetter = { script -> return jobParams } -Closure setupAdditionalTimeoutForDefaultNightly = { script -> - def jobParams = JobParamsUtils.DEFAULT_PARAMS_GETTER(script) - jobParams.env.put('ADDITIONAL_TIMEOUT', '480') - return jobParams +Closure setupAdditionalTimeout = { Closure paramsGetter -> + return { script -> + def jobParams = paramsGetter(script) + jobParams.env.put('ADDITIONAL_TIMEOUT', '480') + return jobParams + } +} + +Closure setupSonarProjectKeyEnv = { Closure paramsGetter -> + return { script -> + def jobParams = paramsGetter(script) + jobParams.env.put('SONAR_PROJECT_KEY', 'apache_incubator-kie-kogito-apps') + return jobParams + } } Closure nightlyJobParamsGetter = isMainStream() ? JobParamsUtils.DEFAULT_PARAMS_GETTER : setup4AMCronTriggerJobParamsGetter -KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true, setupAdditionalTimeoutForDefaultNightly) -setupSpecificBuildChainNightlyJob('sonarcloud', nightlyJobParamsGetter) +KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true, setupAdditionalTimeout(JobParamsUtils.DEFAULT_PARAMS_GETTER)) +setupSpecificBuildChainNightlyJob('sonarcloud', setupAdditionalTimeout(setupSonarProjectKeyEnv(nightlyJobParamsGetter))) setupSpecificBuildChainNightlyJob('native', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-main', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-branch', nightlyJobParamsGetter)