Skip to content

Commit 0712485

Browse files
committed
debugging sonar
1 parent 460a235 commit 0712485

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Jenkinsfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ pipeline {
147147
jdk "JDK 11.0.9"
148148
}
149149
environment {
150+
sonarscanner_config_file = "${sonarscanner_install_dir}/conf/sonar-scanner.properties"
150151
electron_coverage = "${WORKSPACE}/electron/coverage/lcov.info"
151152
webui_coverage = "${WORKSPACE}/webui/coverage/lcov.info"
152153
lcov_report_paths = "${electron_coverage},${webui_coverage}"
@@ -155,19 +156,22 @@ pipeline {
155156
echo "JAVA_HOME = ${JAVA_HOME}"
156157
sh "which java"
157158
sh "java -version"
159+
158160
withSonarQubeEnv('SonarCloud') {
159161
echo "Inside withSonarQubeEnv('SonarCloud') block"
160162
sh "env|sort"
163+
sh """
164+
echo "sonar.host.url=${SONAR_HOST_URL}" >> ${sonarscanner_config_file}
165+
echo "sonar.sourceEncoding=UTF-8" >> ${sonarscanner_config_file}
166+
echo "sonar.organization=${sonar_org}" >> ${sonarscanner_config_file}
167+
echo "sonar.projectKey=${sonar_project_key}" >> ${sonarscanner_config_file}
168+
echo "sonar.projectVersion=${version_prefix}" >> ${sonarscanner_config_file}
169+
echo "sonar.javascript.lcov.reportPaths=${lcov_report_paths}" >> ${sonarscanner_config_file}
170+
cat "${sonarscanner_config_file}"
171+
"""
161172
sh """
162173
SONAR_SCANNER_OPTS="-server"; export SONAR_SCANNER_OPTS
163-
${sonarscanner_exe} \
164-
-Dsonar.host.url=${SONAR_HOST_URL} \
165-
-Dsonar.login=${SONAR_AUTH_TOKEN} \
166-
-Dsonar.organization=${sonar_org} \
167-
-Dsonar.projectKey=${sonar_project_key} \
168-
-Dsonar.projectVersion=${version_prefix} \
169-
-Dsonar.branch.name=${BRANCH_NAME} \
170-
-Dsonar.javascript.lcov.reportPaths="${lcov_report_paths}"
174+
${sonarscanner_exe}
171175
"""
172176
}
173177
}

0 commit comments

Comments
 (0)