-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathJenkinsfile
More file actions
71 lines (53 loc) · 1.87 KB
/
Jenkinsfile
File metadata and controls
71 lines (53 loc) · 1.87 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
pipeline {
agent any
stages {
stage("Source") {
agent any
steps {
git branch: 'master', url: 'https://github.com/BINPIPE/java-springboot-sonarqube.git'
}
}
stage("Build") {
agent any
steps {
sh 'mvn clean package'
}
}
stage("SonarQube Analysis") {
agent any
steps {
sh 'mvn sonar:sonar'
}
}
stage('Approve Deployment') {
agent any
input{
message "Do you want to proceed for deployment?"
}
steps {
//Add deploy steps & Alerts below
sh 'echo "Deploying into Server"'
}
}
} // stage
post {
aborted {
echo "Sending message to Slack"
slackSend (color: "${env.SLACK_COLOR_WARNING}",
channel: "${params.SLACK_CHANNEL_2}",
message: "*ABORTED:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
} // aborted
failure {
echo "Sending message to Slack"
slackSend (color: "${env.SLACK_COLOR_DANGER}",
channel: "${params.SLACK_CHANNEL_2}",
message: "*FAILED:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
} // failure
success {
echo "Sending message to Slack"
slackSend (color: "${env.SLACK_COLOR_GOOD}",
channel: "${params.SLACK_CHANNEL_1}",
message: "*SUCCESS:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
} // success
} // post
}