forked from kserve/kserve
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
39 lines (33 loc) · 1.08 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
@Library("jenkins-library@main")
import com.logicalclocks.jenkins.k8s.ImageBuilder
properties([
parameters([
choice(name: 'image', choices: ['all', 'sklearnserver'], description: 'Which docker image to build'),
choice(name: 'branch', choices: ['', 'master', 'release-0.11.2'], description: 'Which branch to build'),
])
])
node("local") {
stage('Clone repository') {
if (params.branch == '' || params.branch == 'master'){
checkout scm
} else {
sshagent (credentials: ['id_rsa']) {
sh """
git fetch --all
git checkout ${params.branch}
git pull
"""
}
}
}
stage('Build and push image(s)') {
version = readFile "${env.WORKSPACE}/VERSION"
withEnv(["VERSION=${version.trim()}"]) {
if(params.image == 'all' || params.image == 'sklearnserver'){
def builder = new ImageBuilder(this)
m = readFile "${env.WORKSPACE}/python/sklearn-build-manifest.json"
builder.run(m)
}
}
}
}