forked from javahometech/my-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sonarqube-analysis
32 lines (29 loc) · 952 Bytes
/
sonarqube-analysis
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
node{
stage('SCM Checkout'){
git 'https://github.com/javahometech/my-app'
}
stage('Compile-Package'){
// Get maven home path
def mvnHome = tool name: 'maven-3', type: 'maven'
sh "${mvnHome}/bin/mvn package"
}
stage('SonarQube Analysis') {
def mvnHome = tool name: 'maven-3', type: 'maven'
withSonarQubeEnv('sonar-6') {
sh "${mvnHome}/bin/mvn sonar:sonar"
}
}
stage('Email Notification'){
mail bcc: '', body: '''Hi Welcome to jenkins email alerts
Thanks
Hari''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: '[email protected]'
}
stage('Slack Notification'){
slackSend baseUrl: 'https://hooks.slack.com/services/',
channel: '#jenkins-pipeline-demo',
color: 'good',
message: 'Welcome to Jenkins, Slack!',
teamDomain: 'javahomecloud',
tokenCredentialId: 'slack-demo'
}
}