2023-06-11 10:54:35 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
parameters {
|
|
|
|
buildSelector(
|
|
|
|
name: 'BUILD_SELECTOR',
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'A build to take the artifacts from'
|
|
|
|
)
|
2023-06-11 12:40:44 +02:00
|
|
|
string(
|
|
|
|
name: 'EPOCHS',
|
|
|
|
description: 'Number of epochs',
|
|
|
|
defaultValue: '10'
|
|
|
|
)
|
|
|
|
}
|
2023-06-11 10:54:35 +02:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Copy artifacts') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
copyArtifacts(
|
|
|
|
projectName: 'z-s487179-create-dataset',
|
|
|
|
selector: buildParameter('BUILD_SELECTOR'),
|
|
|
|
target: './ML'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-11 11:38:25 +02:00
|
|
|
stage('Run training and save model') {
|
2023-06-11 10:54:35 +02:00
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
sh 'ls -l'
|
|
|
|
docker.image('docker-image').inside {
|
|
|
|
dir('./ML') {
|
|
|
|
sh 'ls -l'
|
|
|
|
sh 'python3 ./model_train.py'
|
2023-06-11 11:38:25 +02:00
|
|
|
archiveArtifacts 'model.pt'
|
2023-06-11 10:54:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|