Skip to content

Commit 848aeb8

Browse files
committed
tweaking sonar configuration to try to get sonar data on the branch
1 parent 4a8712f commit 848aeb8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Jenkinsfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ pipeline {
149149
jdk "JDK 11.0.9"
150150
}
151151
environment {
152+
sonar_branch = sh(returnStdout: true, script: "echo ${GIT_BRANCH} | awk -F/ '{ print $2 }'").trim()
152153
sonarscanner_config_file = "${sonarscanner_install_dir}/conf/sonar-scanner.properties"
153154
electron_coverage = "${WORKSPACE}/electron/coverage/lcov.info"
154155
webui_coverage = "${WORKSPACE}/webui/coverage/lcov.info"
@@ -169,6 +170,7 @@ pipeline {
169170
echo "sonar.organization=${sonar_org}" >> ${sonarscanner_config_file}
170171
echo "sonar.projectKey=${sonar_project_key}" >> ${sonarscanner_config_file}
171172
echo "sonar.projectVersion=${version_prefix}" >> ${sonarscanner_config_file}
173+
echo "sonar.branch=${sonar_branch}" >> ${sonarscanner_config_file}
172174
echo "sonar.javascript.lcov.reportPaths=${lcov_report_paths}" >> ${sonarscanner_config_file}
173175
echo "sonar.c.file.suffixes=-" >> ${sonarscanner_config_file}
174176
echo "sonar.cpp.file.suffixes=-" >> ${sonarscanner_config_file}

0 commit comments

Comments
 (0)