Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BXMSPROD-2104: new parameter for JDK version in SonarCloud analysis #1038

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .ci/jenkins/Jenkinsfile.buildchain
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.kie.jenkins.MavenSettingsUtils
agentLabel = "${env.ADDITIONAL_LABEL?.trim() ?: 'kie-rhel8 && docker && kie-mem16g'} && !built-in"
timeoutValue = env.ADDITIONAL_TIMEOUT?.trim() ?: '180'
jdkTool = env.BUILD_JDK_TOOL
sonarJdkTool = env.SONAR_JDK_TOOL
mavenTool = env.BUILD_MAVEN_TOOL

mavenDeployArtifacts = env.ENABLE_DEPLOY
Expand Down Expand Up @@ -115,7 +116,7 @@ pipeline {
script {
env.LD_LIBRARY_PATH = "${env.LD_LIBRARY_PATH ? "${env.LD_LIBRARY_PATH}:": ''}${GRAALVM_HOME}/lib/server"
echo "LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}"

env.BUILD_MVN_OPTS_CURRENT = "${env.BUILD_MVN_OPTS_CURRENT ?: ''} ${getBuildMavenOptsCurrent()}"
echo "BUILD_MVN_OPTS_CURRENT = ${BUILD_MVN_OPTS_CURRENT}"
if (mavenDeployArtifacts) {
Expand Down Expand Up @@ -156,7 +157,7 @@ pipeline {
expression { return enableSonarCloudAnalysis }
}
tools {
jdk jdkTool
jdk sonarJdkTool
maven mavenTool
}
steps {
Expand Down
1 change: 1 addition & 0 deletions dsl/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,5 @@ jenkins:
default_tools:
jdk: kie-jdk11
maven: kie-maven-3.8.7
sonar_jdk: kie-jdk17
jobs_definition_file: .ci/jenkins/dsl/jobs.groovy
4 changes: 4 additions & 0 deletions dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ class Utils {
return getJenkinsDefaultTools(script, 'maven')
}

static String getJenkinsDefaultSonarJDKTools(def script) {
return getJenkinsDefaultTools(script, 'sonar_jdk')
}

static String getSeedRepo(def script) {
return getBindingValue(script, 'SEED_REPO')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class JobParamsUtils {
static def setupJobParamsDefaultJDKConfiguration(def script, def jobParams) {
jobParams.env = jobParams.env ?: [:]
addJobParamsEnvIfNotExisting(script, jobParams, 'BUILD_JDK_TOOL', Utils.getJenkinsDefaultJDKTools(script))
addJobParamsEnvIfNotExisting(script, jobParams, 'SONAR_JDK_TOOL', Utils.getJenkinsDefaultSonarJDKTools(script))
}

static def setupJobParamsDefaultMavenConfiguration(def script, def jobParams) {
Expand Down