-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
44 lines (42 loc) · 1.07 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
pipeline {
agent any
stages {
stage('build') {
steps {
sh './gradlew clean build'
}
post {
success {
resultSlackSend("CI:Build", "good", "SUCCESS")
}
failure {
resultSlackSend("CI:Build", "danger", "FAILURE")
}
aborted {
resultSlackSend("CI:Build", "warning", "ABORTED")
}
}
}
stage('deploy') {
when { branch 'develop' }
steps {
echo 'start deploy to develop..'
sh 'eb deploy catch-up-dev'
}
post {
success {
resultSlackSend("CD:Deploy", "good", "SUCCESS")
}
failure {
resultSlackSend("CD:Deploy", "danger", "FAILURE")
}
aborted {
resultSlackSend("CD:Deploy", "warning", "ABORTED")
}
}
}
}
}
def resultSlackSend(stage_name ,bar_color, result) {
slackSend color: bar_color, message:"${env.JOB_NAME} - ${stage_name} #${env.BUILD_NUMBER} ${result} after ${currentBuild.durationString.split(" and")[0]} (<${env.BUILD_URL}|Open>)"
}