Skip to content
Snippets Groups Projects
Commit b6f6118f authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'zacharysabourin/main/sonarcloud-bindings' into 'main'

feat: Add SonarCloud bindings

See merge request !41
parents b70ee3d9 e6ed55bd
No related branches found
No related tags found
1 merge request!41feat: Add SonarCloud bindings
Pipeline #42822 passed
......@@ -49,6 +49,9 @@ pipeline {
- mountPath: "/home/jenkins/.cache"
name: "yarn-cache"
readOnly: false
- mountPath: "/home/jenkins/.sonar"
name: "sonar-cache"
readOnly: false
- name: jnlp
resources:
requests:
......@@ -70,6 +73,8 @@ pipeline {
emptyDir: {}
- name: yarn-cache
emptyDir: {}
- name: sonar-cache
emptyDir: {}
'''
}
}
......@@ -114,7 +119,33 @@ pipeline {
}
stages {
stage('Build project') {
stage('Build with Sonarcloud scan') {
when {
branch 'main'
}
steps {
container('buildcontainer') {
readTrusted 'Makefile'
readTrusted 'pom.xml'
readTrusted 'package.json'
sh 'make compile-test-resources'
withCredentials([string(credentialsId: 'sonarcloud-token-eclipsefdn-cve-api', variable: 'SONAR_TOKEN')]) {
sh 'mvn clean verify -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.token=${SONAR_TOKEN}'
}
stash name: "target", includes: "target/**/*"
}
}
}
stage('Build without Sonarcloud scan') {
when {
not {
branch 'main'
}
}
steps {
container('buildcontainer') {
readTrusted 'Makefile'
......
......@@ -24,6 +24,10 @@
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/jacoco-report/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.junit.reportPath>${project.build.directory}/surefire-reports</sonar.junit.reportPath>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>eclipse-foundation-it</sonar.organization>
<sonar.projectKey>eclipsefdn-cve-api</sonar.projectKey>
<sonar.projectName>CVE API</sonar.projectName>
</properties>
<repositories>
<repository>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment