Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HWORKS-1555] Add Jenkins pipeline for building sklearnserver img #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)
}
}
}
}
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.0
7 changes: 7 additions & 0 deletions python/sklearn-build-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name": "hopsworks/sklearnserver",
"version": "env:VERSION",
"dockerFile": "python/sklearn.Dockerfile"
}
]
Loading