We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0fd833 commit 0695ab3Copy full SHA for 0695ab3
1 file changed
Jenkinsfile-sonar.groovy
@@ -0,0 +1,30 @@
1
+// this demo runs in a k8s pod which has a docker container named 'java'
2
+// also, maven is needed in this case.
3
+pipeline {
4
+ agent {
5
+ label 'maven'
6
+ }
7
+
8
+ stages{
9
+ stage('build'){
10
+ steps{
11
+ container('java'){
12
+ sh 'mvn clean package'
13
14
15
16
17
+ stage('sonar scan') {
18
+ steps {
19
20
+ sh '''
21
+ mvn sonar:sonar \
22
+ -Dsonar.projectKey=test \
23
+ -Dsonar.host.url=${SONAR_HOST_URL} \
24
+ -Dsonar.login=${SONAR_LOGIN}
25
+ '''
26
27
28
29
30
+}
0 commit comments