Skip to content
Snippets Groups Projects

feat: Add Sonarcloud bindings

1 unresolved thread
2 files
+ 37
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 33
2
@@ -10,7 +10,7 @@ pipeline {
spec:
containers:
- name: buildcontainer
image: eclipsefdn/stack-build-agent:latest
image: eclipsefdn/stack-build-agent:h111.3-n18.16-jdk11
imagePullPolicy: Always
command:
- cat
@@ -48,6 +48,9 @@ pipeline {
- mountPath: "/home/jenkins/.cache"
name: "yarn-cache"
readOnly: false
- mountPath: "/home/jenkins/.sonar"
name: "sonar-cache"
readOnly: false
- name: jnlp
resources:
requests:
@@ -69,6 +72,8 @@ pipeline {
emptyDir: {}
- name: yarn-cache
emptyDir: {}
- name: sonar-cache
emptyDir: {}
'''
}
}
@@ -103,7 +108,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-profile-api', variable: 'SONAR_TOKEN')]) {
sh 'mvn clean verify -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.login=${SONAR_TOKEN} -Dmaven.test.skip=true'
}
stash name: "target", includes: "target/**/*"
}
}
}
stage('Build without Sonarcloud scan') {
when {
not {
branch 'main'
}
}
steps {
container('buildcontainer') {
readTrusted 'Makefile'
Loading