Skip to content

Commit

Permalink
kie-issues_599: specify projectKey for sonar analysis (#1910)
Browse files Browse the repository at this point in the history
Co-authored-by: jstastny-cz <[email protected]>
  • Loading branch information
jstastny-cz and jstastny-cz authored Nov 3, 2023
1 parent 5d983b6 commit fcb8acd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 16 additions & 6 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fcb8acd

Please sign in to comment.