pipeline { agent { dockerfile true } parameters { string( defaultValue: '5', description: 'epochs number', name: 'epochs' ), string { defaultValue: '--save', description: 'save model after training', name: 'save_model' } } 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 { emailtext body: 'SUCCESS', subject: "s478841-training", to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } failure { emailtext body: 'FAILURE', subject: "s478841-training", to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } unstable { emailtext body: 'UNSTABLE', subject: "s478841-training", to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } changed { emailtext body: 'CHANGED', subject: "s478841-training", to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } } }