2022-05-02 10:52:18 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|
|
|
|
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 {
|
|
|
|
copyArtifacts filter: '*.csv', fingerprintArtifacts: true, projectName: 's478841-create-dataset', selector: lastSuccessful()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Model training') {
|
|
|
|
steps {
|
|
|
|
sh "chmod +x -R ${env.WORKSPACE}"
|
|
|
|
sh 'python model.py -e $epochs $save_model'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive artifacts') {
|
|
|
|
steps {
|
|
|
|
archiveArtifacts artifacts: '*data/predictions.csv', onlyIfSuccessful: true
|
|
|
|
archiveArtifacts artifacts: '*data/model_scripted*', onlyIfSuccessful: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
success {
|
2022-05-02 10:59:57 +02:00
|
|
|
emailtext 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 10:59:57 +02:00
|
|
|
emailtext 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 10:59:57 +02:00
|
|
|
emailtext 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 10:59:57 +02:00
|
|
|
emailtext body: 'CHANGED', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
2022-05-02 10:52:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|