-
Notifications
You must be signed in to change notification settings - Fork 81
/
Jenkinsfile
31 lines (30 loc) · 945 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
pipeline {
agent {
node {
label "valaxy"
}
}
stages {
stage('Build') {
steps {
echo '<--------------- Building started --------------->'
sh 'printenv'
sh 'mvn clean install'
echo '<------------- Build completed --------------->'
}
}
stage ("Sonar Analysis") {
environment {
scannerHome = tool 'Valaxy-SonarScanner' //scanner name configured for slave
}
steps {
echo '<--------------- Sonar Analysis started --------------->'
withSonarQubeEnv('Valaxy-SonarQube') {
//sonarqube server name in master
sh "${scannerHome}/bin/sonar-scanner"
}
echo '<--------------- Sonar Analysis stopped --------------->'
}
}
}
}