-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
37 lines (34 loc) · 929 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// -*- mode: groovy -*-
// vim: set filetype=groovy :
pipeline {
agent any
tools {
maven "Maven"
}
environment {
SONNAR_HOME = "/var/jenkins_home/sonar-scanner/sonar-scanner-4.7.0.2747-linux"
}
node {
stage('SCM') {
checkout scm
}
stage('SonarQube Analysis') {
def mvn = tool 'Default Maven';
withSonarQubeEnv() {
sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=simple-test-project"
}
}
}
stages {
stage('Build/Test') {
steps {
echo 'Testing - Coverage Test (Unit/IT)'
sh "mvn clean package"
echo 'SonarQube'
withSonarQubeEnv(credentialsId: 'JenkinsTokenSonar', installationName: 'sonarqubeserver') {
sh "$SONNAR_HOME/bin/sonar-scanner -Dproject.settings='sonar-project.properties'"
}
}
}
}
}