Skip to content

Commit c0f0eec

Browse files
authored
[HWORKS-1555] Add Jenkins pipeline for building sklearnserver img (#27)
1 parent 790dc37 commit c0f0eec

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

Jenkinsfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@Library("jenkins-library@main")
2+
3+
import com.logicalclocks.jenkins.k8s.ImageBuilder
4+
5+
properties([
6+
parameters([
7+
choice(name: 'image', choices: ['all', 'sklearnserver'], description: 'Which docker image to build'),
8+
choice(name: 'branch', choices: ['', 'master', 'release-0.11.2'], description: 'Which branch to build'),
9+
])
10+
])
11+
12+
node("local") {
13+
stage('Clone repository') {
14+
if (params.branch == '' || params.branch == 'master'){
15+
checkout scm
16+
} else {
17+
sshagent (credentials: ['id_rsa']) {
18+
sh """
19+
git fetch --all
20+
git checkout ${params.branch}
21+
git pull
22+
"""
23+
}
24+
}
25+
}
26+
27+
stage('Build and push image(s)') {
28+
version = readFile "${env.WORKSPACE}/VERSION"
29+
withEnv(["VERSION=${version.trim()}"]) {
30+
31+
if(params.image == 'all' || params.image == 'sklearnserver'){
32+
33+
def builder = new ImageBuilder(this)
34+
m = readFile "${env.WORKSPACE}/python/sklearn-build-manifest.json"
35+
builder.run(m)
36+
}
37+
}
38+
}
39+
}

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.0

python/sklearn-build-manifest.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"name": "hopsworks/sklearnserver",
4+
"version": "env:VERSION",
5+
"dockerFile": "python/sklearn.Dockerfile"
6+
}
7+
]

0 commit comments

Comments
 (0)