forked from SeldonIO/cicd-demo-model-source-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.build-model-images-job
37 lines (33 loc) · 1.09 KB
/
Jenkinsfile.build-model-images-job
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
def label = "worker-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
containerTemplate(
name: 'kubectl',
image: 'seldonio/k8s-deployer:k8s_v1.10.0',
command: 'cat',
ttyEnabled: true,
envVars: [
secretEnvVar(key: 'GITHUB_USER', secretName: 'github-credentials', secretKey: 'user'),
secretEnvVar(key: 'GITHUB_TOKEN', secretName: 'github-credentials', secretKey: 'token')
]),
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock')
]) {
node(label) {
def myRepo = checkout scm
def gitCommit = myRepo.GIT_COMMIT
def gitBranch = myRepo.GIT_BRANCH
stage('activity-monitor') {
container('kubectl') {
sh "curl -s activity-monitor.default.svc.cluster.local:80/?'(JENKINS) build-model-images-job run for v'${BUILD_ID} > /dev/null"
}
}
stage('build-model') {
container('kubectl') {
sh 'pwd'
sh 'ls -al'
sh "make -f Makefile.build-model-images-job do_build MODEL_VERSION=v${BUILD_ID}"
}
}
}
}