-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
48 lines (39 loc) · 1.13 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
def lastStage = ''
node('node') {
properties([disableConcurrentBuilds()])
try {
currentBuild.result = "SUCCESS"
stage('Checkout') {
lastStage = env.STAGE_NAME
timeout(time: 10, unit: 'MINUTES') {
checkout scm
}
echo "Current build result: ${currentBuild.result}"
}
stage('Build and push images') {
lastStage = env.STAGE_NAME
timeout(time: 1, unit: 'HOURS') {
sh 'make build-and-push-images'
}
echo "Current build result: ${currentBuild.result}"
}
}
catch (err) {
echo "Caught errors! ${err}"
echo "Setting build result to FAILURE"
currentBuild.result = "FAILURE"
slackSend color: 'danger', message: "@build-team ci branch ${env.BRANCH_NAME} build failed during stage ${lastStage} ${env.BUILD_URL}"
mail from: '[email protected]',
replyTo: '[email protected]',
to: '[email protected]',
subject: "storj/ci branch ${env.BRANCH_NAME} build failed",
body: "Project build log: ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh script: 'make clean', returnStatus: true
deleteDir()
}
}
}