forked from storj/storj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
92 lines (67 loc) · 2.07 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
node('node') {
properties([disableConcurrentBuilds()])
try {
currentBuild.result = "SUCCESS"
stage('Checkout') {
checkout scm
echo "Current build result: ${currentBuild.result}"
}
stage('Build Binaries') {
sh 'make binaries'
stash name: "storagenode-binaries", includes: "release/**/storagenode*.exe"
echo "Current build result: ${currentBuild.result}"
}
stage('Build Windows Installer') {
node('windows') {
checkout scm
unstash "storagenode-binaries"
bat 'installer\\windows\\build.bat'
stash name: "storagenode-installer", includes: "release/**/storagenode*.msi"
echo "Current build result: ${currentBuild.result}"
}
}
stage('Sign Windows Installer') {
unstash "storagenode-installer"
sh 'make sign-windows-installer'
echo "Current build result: ${currentBuild.result}"
}
stage('Build Images') {
sh 'make images'
echo "Current build result: ${currentBuild.result}"
}
stage('Push Images') {
echo 'Push to Repo'
sh 'make push-images'
echo "Current build result: ${currentBuild.result}"
}
if (env.BRANCH_NAME == "master") {
/* This should only deploy to staging if the branch is master */
stage('Deploy to staging') {
sh 'make deploy'
echo "Current build result: ${currentBuild.result}"
}
}
stage('Upload') {
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', message: "@channel ${env.BRANCH_NAME} build failed ${env.BUILD_URL}"
mail from: 'builds@storj.io',
replyTo: 'builds@storj.io',
to: 'builds@storj.io',
subject: "storj/storj branch ${env.BRANCH_NAME} build failed",
body: "Project build log: ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh 'make clean-images'
deleteDir()
}
}
}