forked from SeldonIO/seldon-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
75 lines (74 loc) · 2.83 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
pipeline {
parameters {
booleanParam(name: 'IS_DISABLED_APIFE_BUILD', defaultValue: false, description: '')
booleanParam(name: 'IS_DISABLED_ENGINE_BUILD', defaultValue: false, description: '')
booleanParam(name: 'IS_DISABLED_CLUSTERMANAGER_BUILD', defaultValue: false, description: '')
booleanParam(name: 'IS_IMAGE_BEING_PUBLISHED', defaultValue: false, description: '')
}
agent {
docker {
image 'seldonio/core-builder:0.3'
args '-v /root/.m2:/root/.m2'
}
}
environment {
SELDON_CORE_DOCKER_HUB_USER = credentials('SELDON_CORE_DOCKER_HUB_USER')
SELDON_CORE_DOCKER_HUB_PASSWORD = credentials('SELDON_CORE_DOCKER_HUB_PASSWORD')
}
stages {
stage('build-api-frontend') {
when {
expression { return params.IS_DISABLED_APIFE_BUILD == false }
}
steps {
echo "Build Image"
sh 'cd api-frontend && make -f Makefile.ci build'
script {
if (params.IS_IMAGE_BEING_PUBLISHED == true) {
echo "Publish Image"
sh 'cd api-frontend && make -f Makefile.ci repo_login'
sh 'cd api-frontend && make -f Makefile.ci push_image'
} else {
echo "Publish Image [SKIPPED]"
}
}
}
}
stage('build-engine') {
when {
expression { return params.IS_DISABLED_ENGINE_BUILD == false }
}
steps {
echo "Build Image"
sh 'cd engine && make -f Makefile.ci build'
script {
if (params.IS_IMAGE_BEING_PUBLISHED == true) {
echo "Publish Image"
sh 'cd engine && make -f Makefile.ci repo_login'
sh 'cd engine && make -f Makefile.ci push_image'
} else {
echo "Publish Image [SKIPPED]"
}
}
}
}
stage('build-cluster-manager') {
when {
expression { return params.IS_DISABLED_CLUSTERMANAGER_BUILD == false }
}
steps {
echo "Build Image"
sh 'cd cluster-manager && make -f Makefile.ci build'
script {
if (params.IS_IMAGE_BEING_PUBLISHED == true) {
echo "Publish Image"
sh 'cd cluster-manager && make -f Makefile.ci repo_login'
sh 'cd cluster-manager && make -f Makefile.ci push_image'
} else {
echo "Publish Image [SKIPPED]"
}
}
}
}
}
}