forked from valentinabojan/jenkins-pipeline-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (62 loc) · 1.62 KB
/
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
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
pipeline {
agent any
environment {
MAVEN_INSTALLATION = 'maven-installation'
MAVEN_SETTINGS_CONFIG = 'maven-settings.xml'
}
stages {
stage('Init') {
steps {
script {
stagesLib = load "stages.groovy"
slackNotifier = load "slack-notifier.groovy"
}
}
}
stage('Build') {
steps {
script {
stagesLib.buildApplication()
slackNotifier.sendSlackNotificationForRegularStage()
}
}
}
stage('Test') {
steps {
script {
stagesLib.runAllTests()
slackNotifier.sendSlackNotificationForRegularStage()
}
}
}
stage('Deploy') {
input {
message 'Do you want to deploy?'
submitterParameter 'responder'
}
steps {
script {
stagesLib.deployApplication()
slackNotifier.sendSlackNotificationForApprovedStage(responder)
}
}
}
}
post {
success {
script {
slackNotifier.sendSlackNotificationForSuccessfulBuild()
}
}
failure {
script {
slackNotifier.sendSlackNotificationForFailedBuild()
}
}
aborted {
script {
slackNotifier.sendSlackNotificationForAbortedBuild()
}
}
}
}