ium_478841/jenkins/training.Jenkinsfile

62 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-05-02 10:52:18 +02:00
pipeline {
agent {
2022-05-02 11:07:42 +02:00
docker { image 's478841-image:latest' }
2022-05-02 10:52:18 +02:00
}
parameters {
string(
defaultValue: '5',
description: 'epochs number',
name: 'epochs'
2022-05-02 10:59:57 +02:00
)
2022-05-02 10:54:49 +02:00
string (
2022-05-02 10:52:18 +02:00
defaultValue: '--save',
description: 'save model after training',
name: 'save_model'
2022-05-02 10:54:49 +02:00
)
2022-05-02 10:52:18 +02:00
}
2022-05-02 11:07:42 +02:00
2022-05-02 10:52:18 +02:00
stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/develop']], extensions: [], userRemoteConfigs: [
[url: 'https://git.wmi.amu.edu.pl/s478841/ium_478841.git']]])
}
}
stage('Copy Artifacts') {
steps {
2022-05-02 11:48:33 +02:00
copyArtifacts filter: 'data/avocado.data*', fingerprintArtifacts: true, projectName: 's478841-create-dataset', selector: lastSuccessful()
2022-05-02 10:52:18 +02:00
}
}
stage('Model training') {
steps {
sh "chmod +x -R ${env.WORKSPACE}"
2022-05-02 13:04:47 +02:00
sh 'python3 scripts/model.py -e $epochs $save_model'
2022-05-02 10:52:18 +02:00
}
}
stage('Archive artifacts') {
steps {
archiveArtifacts artifacts: '*data/predictions.csv', onlyIfSuccessful: true
archiveArtifacts artifacts: '*data/model_scripted*', onlyIfSuccessful: true
}
}
}
post {
success {
2022-05-02 12:00:26 +02:00
emailext body: 'SUCCESS', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
2022-05-02 10:54:49 +02:00
2022-05-02 10:52:18 +02:00
failure {
2022-05-02 12:00:26 +02:00
emailext body: 'FAILURE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
unstable {
2022-05-02 12:00:26 +02:00
emailext body: 'UNSTABLE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
changed {
2022-05-02 12:00:26 +02:00
emailext body: 'CHANGED', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
}
}