-
Notifications
You must be signed in to change notification settings - Fork 18
/
Jenkinsfile.private
77 lines (59 loc) · 1.87 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
71
72
73
74
75
76
77
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}"
}
stage('Deploy to staging') {
lastStage = env.STAGE_NAME
// run the edge deployment job. propagate will ensure we mark this build
// as failed if the deployment job fails
build job: 'edge-deployment', wait: true, propagate: true, parameters: [
extendedChoice(name: 'REGIONS', value: 'Europe (Staging)'),
extendedChoice(name: 'SERVICES', value: 'Authservice,Gateway-MT,Linksharing'),
booleanParam(name: 'CONFIRM', value: false)
]
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-integrations-edge', message: "@edge edge branch ${env.BRANCH_NAME} build failed during stage ${lastStage} ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh 'make clean-images'
deleteDir()
}
}
}