-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
43 lines (33 loc) · 1.15 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
properties([buildDiscarder(logRotator(daysToKeepStr: '', numToKeepStr: '20'))])
notifyStarted()
node ("docker") {
try {
stage "checkout"
checkout scm
stage 'install'
sh "docker-compose run --rm go make clean dependencies"
stage 'test'
sh "docker-compose run --rm go make test benchmark integration"
stage 'build'
sh "docker-compose run --rm go ./ci/cross_compile.sh \"${env.BRANCH_NAME}\""
stage 'post build'
if (env.BRANCH_NAME == "master") {
sh "make upload"
}
sh "docker-compose run --rm go make clean"
notifySuccessful()
} catch (e) {
currentBuild.result = "FAILED"
notifyFailed()
throw e
}
}
def notifyStarted() {
slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
def notifySuccessful() {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
def notifyFailed() {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}