Merge branch '73-setup-sonarqube-pipeline-for-development-branch' into 'dev'

Resolve "Setup SonarQube pipeline for development branch"

Closes #73

See merge request sa4-2020/the-sanmarinoes/backend!116
This commit is contained in:
Luca Ponzanelli 2020-05-07 13:39:09 +02:00
commit b5def1b50d
2 changed files with 17 additions and 11 deletions

View file

@ -52,14 +52,10 @@ test:
reports:
junit: build/test-results/test/TEST-*.xml
#Runs a quality check on the code and creates a report on the codes
code_quality:
sonarqube:
image: gradle:jdk11
stage: code_quality
allow_failure: true
only:
- dev
script:
- gradle cpdCheck
artifacts:
paths:
- build/reports/cpd/cpdCheck.xml
#create a report on the quality of the code
expose_as: 'Code Quality Report'
- gradle build jacocoTestReport sonarqube -Dsonar.verbose=true -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.projectKey=$CI_PROJECT_ PATH_SLUG -Dsonar.projectName=$CI_PROJECT_PATH_SLUG -Dsonar.scm.disabled=True -Dsonar.coverage.jacoco.xmlReportPaths=./build/reports/jacoco/test/jacocoTestReport.xml

View file

@ -1,9 +1,9 @@
plugins {
id 'org.springframework.boot' version '2.2.4.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id "de.aaschmid.cpd" version "3.1"
id "org.sonarqube" version "2.7"
id 'java'
id 'jacoco'
id "org.sonarqube" version "2.8"
}
group = 'ch.usi.inf.sa4.sanmarinoes'
version = '0.0.1-SNAPSHOT'
@ -51,3 +51,13 @@ gradle.projectsEvaluated {
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.enabled true
}
}
plugins.withType(JacocoPlugin) {
tasks["test"].finalizedBy 'jacocoTestReport'
}