From 3a04975f63ee9960c0e8cc04fdb5daa3168bfb5e Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 24 Apr 2024 16:28:02 -0600 Subject: [PATCH] Feature #521 main_v5.1 sonarqube_properties (#529) * Per #521, same sonar-project.properties changes but for the main_v5.1 branch * Per #521, based on feedback from Tatiana, exclude the METviewer test directory from the scan and code coverage computations. * Per #521, try specifying the file exclusions rather than top-level directories --- .github/jobs/build_docker_image.sh | 4 ++-- internal/scripts/sonarqube/sonar-project.properties | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/jobs/build_docker_image.sh b/.github/jobs/build_docker_image.sh index d8e0e963..4d375382 100755 --- a/.github/jobs/build_docker_image.sh +++ b/.github/jobs/build_docker_image.sh @@ -18,7 +18,7 @@ if [ $? != 0 ]; then exit 1 fi -# Copy the dist directory from the image +# Copy the build directory from the image id=$(docker create ${DOCKERHUB_TAG}) -time_command docker cp $id:/METviewer/dist dist +time_command docker cp $id:/METviewer/build build docker rm -v $id diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 3586fc31..c6cf4de9 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -4,9 +4,11 @@ sonar.projectName=METviewer sonar.projectVersion=SONAR_PROJECT_VERSION sonar.branch.name=SONAR_BRANCH_NAME sonar.sources=java -sonar.java.libraries=dist/lib -sonar.java.binaries=dist/metviewer/WEB-INF/classes +sonar.java.libraries=lib +sonar.java.binaries=build sonar.sourceEncoding=UTF-8 +sonar.exclusions=java/edu/ucar/metviewer/test/*,java/edu/ucar/metviewer/test/**/* +sonar.coverage.exclusions=java/edu/ucar/metviewer/test/*,java/edu/ucar/metviewer/test/**/* # SonarQube server sonar.host.url=SONAR_HOST_URL