@@ -147,6 +147,7 @@ pipeline {
147
147
jdk " JDK 11.0.9"
148
148
}
149
149
environment {
150
+ sonarscanner_config_file = " ${ sonarscanner_install_dir} /conf/sonar-scanner.properties"
150
151
electron_coverage = " ${ WORKSPACE} /electron/coverage/lcov.info"
151
152
webui_coverage = " ${ WORKSPACE} /webui/coverage/lcov.info"
152
153
lcov_report_paths = " ${ electron_coverage} ,${ webui_coverage} "
@@ -155,19 +156,22 @@ pipeline {
155
156
echo " JAVA_HOME = ${ JAVA_HOME} "
156
157
sh " which java"
157
158
sh " java -version"
159
+
158
160
withSonarQubeEnv(' SonarCloud' ) {
159
161
echo " Inside withSonarQubeEnv('SonarCloud') block"
160
162
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
+ """
161
172
sh """
162
173
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}
171
175
"""
172
176
}
173
177
}
0 commit comments