-
Notifications
You must be signed in to change notification settings - Fork 19
/
Jenkinsfile.private
70 lines (53 loc) · 1.54 KB
/
Jenkinsfile.private
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
68
69
70
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 Binaries') {
lastStage = env.STAGE_NAME
environment {
RELEASE_BUILD_REQUIRED = 'true'
}
sh 'make binaries'
echo "Current build result: ${currentBuild.result}"
}
stage('Build Images') {
lastStage = env.STAGE_NAME
sh 'make images'
echo "Current build result: ${currentBuild.result}"
}
stage('Push Images') {
lastStage = env.STAGE_NAME
sh 'make push-images'
echo "Current build result: ${currentBuild.result}"
}
stage('Upload') {
lastStage = env.STAGE_NAME
sh 'make binaries-upload'
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 gateway-st branch ${env.BRANCH_NAME} build failed during stage ${lastStage} ${env.BUILD_URL}"
mail from: '[email protected]',
replyTo: '[email protected]',
to: '[email protected]',
subject: "storj/gateway-st branch ${env.BRANCH_NAME} build failed",
body: "Project build log: ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh 'make clean-images'
deleteDir()
}
}
}