forked from minio/mint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (40 loc) · 1.16 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
def lastStage = ''
node('node') {
properties([disableConcurrentBuilds()])
try {
currentBuild.result = "SUCCESS"
stage('Checkout') {
lastStage = env.STAGE_NAME
checkout scm
echo "Current build result: ${currentBuild.result}"
}
stage('Build image') {
lastStage = env.STAGE_NAME
sh 'make build-image'
echo "Current build result: ${currentBuild.result}"
}
stage('Push image') {
lastStage = env.STAGE_NAME
sh 'make push-image'
echo "Current build result: ${currentBuild.result}"
}
}
catch (err) {
echo "Caught errors! ${err}"
echo "Setting build result to FAILURE"
currentBuild.result = "FAILURE"
slackSend color: 'danger', channel: '#team-edge', message: "@edge ${env.BRANCH_NAME} build failed during stage ${lastStage} ${env.BUILD_URL}"
mail from: 'builds@storj.io',
replyTo: 'builds@storj.io',
to: 'builds@storj.io',
subject: "storj/gateway-mint branch ${env.BRANCH_NAME} build failed",
body: "Project build log: ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh 'make clean-image'
deleteDir()
}
}
}