ium-helloworld/Jenkinsfile

42 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-05-26 21:26:06 +02:00
node {
2021-05-26 21:40:21 +02:00
def img
stage("Properties"){
properties([
2021-05-26 21:41:36 +02:00
pipelineTriggers([
pollSCM(''),
[$class: 'GogsTrigger']
])
2021-05-26 21:40:21 +02:00
])
}
stage("Checkout"){
git 'https://git.wmi.amu.edu.pl/tzietkiewicz/ium-helloworld.git'
}
stage('Environment') { // for display purposes
img = docker.build('ium-helloworld')
}
2021-06-04 15:11:57 +02:00
img.inside('-v /tmp/mlruns:/tmp/mlruns -v /mlruns:/mlruns ') {
2021-05-26 21:40:21 +02:00
2021-06-04 15:11:57 +02:00
stage('MLflow') {
2021-05-26 21:26:06 +02:00
sh 'ls -l /tmp/mlruns'
sh 'ls -l /mlruns'
2021-06-04 15:11:57 +02:00
sh 'python3 ./train.py'
2021-05-26 21:26:06 +02:00
sh 'ls -l /tmp/mlruns'
sh 'ls -l /mlruns'
2021-05-26 21:40:21 +02:00
}
2021-06-04 15:11:57 +02:00
stage("DVC"){
withCredentials([sshUserPrivateKey(credentialsId: '48ac7004-216e-4260-abba-1fe5db753e18', keyFileVariable: 'IUM_SFTP_KEY')]) {
2021-06-04 15:56:20 +02:00
sh "dvc init -f"
2021-06-04 15:11:57 +02:00
sh "dvc remote add -d ium_ssh_remote ssh://ium-sftp@tzietkiewicz.vm.wmi.amu.edu.pl/ium-sftp"
sh "dvc remote modify --local ium_ssh_remote keyfile $IUM_SFTP_KEY"
sh "dvc pull"
}
}
2021-05-26 21:26:06 +02:00
}
}