Skip to content
Snippets Groups Projects

feat: Add SonarCloud bindings

1 unresolved thread
2 files
+ 36
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 32
1
@@ -48,6 +48,9 @@ pipeline {
@@ -48,6 +48,9 @@ pipeline {
- mountPath: "/home/jenkins/.cache"
- mountPath: "/home/jenkins/.cache"
name: "yarn-cache"
name: "yarn-cache"
readOnly: false
readOnly: false
 
- mountPath: "/home/jenkins/.sonar"
 
name: "sonar-cache"
 
readOnly: false
- name: jnlp
- name: jnlp
resources:
resources:
requests:
requests:
@@ -69,6 +72,8 @@ pipeline {
@@ -69,6 +72,8 @@ pipeline {
emptyDir: {}
emptyDir: {}
- name: yarn-cache
- name: yarn-cache
emptyDir: {}
emptyDir: {}
 
- name: sonar-cache
 
emptyDir: {}
'''
'''
}
}
}
}
@@ -103,7 +108,33 @@ pipeline {
@@ -103,7 +108,33 @@ pipeline {
}
}
stages {
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-working-groups-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 {
steps {
container('buildcontainer') {
container('buildcontainer') {
readTrusted 'Makefile'
readTrusted 'Makefile'
Loading