2024-04-01 16:14:55 +02:00
|
|
|
pipeline {
|
2024-05-04 10:40:09 +02:00
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
2024-05-04 11:26:17 +02:00
|
|
|
|
|
|
|
pipelineTriggers {
|
|
|
|
upstream(upstreamProjects: 'z-s464913-create-dataset', threshold: hudson.model.Result.SUCCESS)
|
|
|
|
}
|
2024-03-24 11:31:18 +01:00
|
|
|
|
|
|
|
parameters {
|
2024-05-04 10:40:09 +02:00
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR'
|
2024-03-24 11:31:18 +01:00
|
|
|
)
|
2024-05-04 11:26:17 +02:00
|
|
|
string(name: 'learning_rate', defaultValue: '0.001', description: 'Learning rate')
|
|
|
|
string(name: 'epochs', defaultValue: '5', description: 'Number of epochs')
|
2024-03-24 11:31:18 +01:00
|
|
|
}
|
2024-03-24 12:13:05 +01:00
|
|
|
|
2024-04-01 18:03:42 +02:00
|
|
|
stages {
|
2024-04-01 18:04:49 +02:00
|
|
|
stage('Clone Repository') {
|
|
|
|
steps {
|
2024-05-04 10:40:09 +02:00
|
|
|
git branch: 'training', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
|
2024-04-01 18:04:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-04 10:40:09 +02:00
|
|
|
stage('Copy Artifacts') {
|
2024-04-01 18:04:49 +02:00
|
|
|
steps {
|
2024-05-04 10:40:09 +02:00
|
|
|
copyArtifacts filter: 'data/*', projectName: 'z-s464913-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
2024-04-01 18:04:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-04 10:40:09 +02:00
|
|
|
stage('Run train_model script') {
|
2024-04-01 17:46:47 +02:00
|
|
|
steps {
|
2024-05-04 10:40:09 +02:00
|
|
|
sh 'chmod +x train_model.py'
|
|
|
|
sh 'python3 ./train_model.py'
|
2024-04-01 18:04:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Archive Artifacts') {
|
|
|
|
steps {
|
2024-05-04 10:40:09 +02:00
|
|
|
archiveArtifacts artifacts: 'model/*', onlyIfSuccessful: true
|
2024-03-24 11:31:18 +01:00
|
|
|
}
|
2024-03-20 14:24:07 +01:00
|
|
|
}
|
2024-03-24 11:31:18 +01:00
|
|
|
}
|
2024-03-20 14:21:31 +01:00
|
|
|
}
|