2024-03-20 14:34:00 +01:00
|
|
|
pipeline {
|
2024-04-02 14:15:40 +02:00
|
|
|
agent any
|
2024-04-29 21:09:13 +02:00
|
|
|
parameters {
|
|
|
|
buildSelector (
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Build for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR'
|
|
|
|
)
|
2024-04-29 21:21:21 +02:00
|
|
|
string(name: 'EPOCHS', defaultValue: '10', description: 'epochs')
|
2024-04-29 21:09:13 +02:00
|
|
|
}
|
2024-03-20 14:34:00 +01:00
|
|
|
stages {
|
2024-04-02 19:05:02 +02:00
|
|
|
stage('Git Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
2024-04-29 21:02:47 +02:00
|
|
|
stage('Copy Artifacts') {
|
|
|
|
steps {
|
|
|
|
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
|
|
|
}
|
2024-04-02 19:36:23 +02:00
|
|
|
}
|
2024-04-29 21:02:47 +02:00
|
|
|
stage('Train') {
|
2024-04-14 12:58:46 +02:00
|
|
|
steps {
|
2024-04-14 13:03:36 +02:00
|
|
|
script {
|
2024-04-14 12:58:46 +02:00
|
|
|
def customImage = docker.build("custom-image")
|
|
|
|
customImage.inside {
|
2024-04-29 21:21:21 +02:00
|
|
|
sh 'python3 ./model.py ${params.EPOCHS}'
|
2024-04-14 12:58:46 +02:00
|
|
|
archiveArtifacts artifacts: 'model.pth, predictions.txt', onlyIfSuccessful: true
|
|
|
|
}
|
2024-04-14 13:03:36 +02:00
|
|
|
}
|
2024-04-14 12:58:46 +02:00
|
|
|
}
|
|
|
|
}
|
2024-04-29 21:22:42 +02:00
|
|
|
}
|
|
|
|
}
|