pipeline { agent any; parameters{ buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'WHICH_BUILD' ) string( defaultValue: '16', description: 'batch size', name: 'BATCH_SIZE' ) string( defaultValue: '15', description: 'epochs', name: 'EPOCHS' ) } stages { stage('copy artifacts') { steps { copyArtifacts(fingerprintArtifacts: true, projectName: 's434695-create-dataset', selector: buildParameter('WHICH_BUILD')) } } stage('docker-training') { steps { script { def img = docker.build('shroomy/ium2:2') img.inside { sh "python3 train.py ${EPOCHS} ${BATCH_SIZE}" } } } } stage('Archive artifacts') { steps{ archiveArtifacts 'vgsales_model.h5' archiveArtifacts 'my_runs/**' } } } post { success { build job: 's434695-evaluation/master' mail body: 'SUCCESS TRAINING', subject: 's434695', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' } failure { mail body: 'FAILURE TRAINING', subject: 's434695', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' } } }