54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
pipeline {
|
|
agent any;
|
|
parameters{
|
|
buildSelector(
|
|
defaultSelector: lastSuccessful(),
|
|
description: 'Which build to use for copying artifacts',
|
|
name: 'BUILD_SELECTOR'
|
|
)
|
|
string(
|
|
defaultValue: '10',
|
|
description: 'batch size',
|
|
name: 'BATCH_SIZE'
|
|
)
|
|
string(
|
|
defaultValue: '5',
|
|
description: 'epochs',
|
|
name: 'EPOCHS'
|
|
|
|
)
|
|
}
|
|
|
|
stages{
|
|
stage('copy-artifacts') {
|
|
steps {
|
|
copyArtifacts fingerprintArtifacts: true, projectName: 's434784-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
|
}
|
|
}
|
|
|
|
stage('docker-training') {
|
|
steps {
|
|
script {
|
|
def image = docker.build('dock')
|
|
image.inside{
|
|
sh 'chmod +x training.py'
|
|
sh 'python3 training.py ${EPOCHS} ${BATCH_SIZE}'
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('archive-model') {
|
|
steps{
|
|
archiveArtifacts 'sucides_model.h5'
|
|
}
|
|
}
|
|
stage('send-mail') {
|
|
steps{
|
|
emailext body: currentBuild.result ?: 'SUCCESS',
|
|
subject: 's434784-training',
|
|
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
|
|
}
|
|
}
|
|
}
|
|
} |