forked from tmtsoftware/esw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnightly
58 lines (51 loc) · 1.29 KB
/
nightly
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
pipeline {
agent {
label 'master'
}
options {
timeout(time: 2, unit: 'HOURS')
timestamps()
}
stages {
stage('Checkout') {
steps {
git '[email protected]:tmtsoftware/esw.git'
}
}
stage('Build') {
steps {
sh "sbt clean compile"
}
}
stage('Paradox Validate Links') {
steps {
sh "sbt docs/Paradox/paradoxValidateLinks"
}
}
}
post {
always {
script {
sendNotification(currentBuild.result)
}
}
}
}
def sendNotification(String buildStatus = 'STARTED') {
buildStatus = buildStatus ?: 'SUCCESS'
def colorCode = '#FF0000'
def subject = "${buildStatus}: Job '${env.JOB_NAME}' [${env.BUILD_NUMBER}]'"
def summary = "${subject} (${env.BUILD_URL})"
// override default values based on build status
if (buildStatus == 'STARTED') {
color = 'YELLOW'
colorCode = '#FFFF00'
} else if (buildStatus == 'SUCCESS') {
color = 'GREEN'
colorCode = '#00FF00'
} else {
color = 'RED'
colorCode = '#FF0000'
}
slackSend(channel: "#esw-build", color: colorCode, message: summary)
}