ium_464913/Jenkinsfile
2024-05-04 11:48:12 +02:00

46 lines
1.1 KiB
Groovy

pipeline {
agent {
dockerfile true
}
triggers {
upstream(upstreamProjects: 'z-s464913-create-dataset', threshold: hudson.model.Result.SUCCESS)
}
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
string(name: 'LEARNING_RATE', defaultValue: '0.001', description: 'Learning rate')
string(name: 'EPOCHS', defaultValue: '5', description: 'Number of epochs')
}
stages {
stage('Clone Repository') {
steps {
git branch: 'training', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: 'data/*', projectName: 'z-s464913-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Run train_model script') {
steps {
sh 'chmod +x train_model.py'
sh "python3 ./train_model.py ${params.LEARNING_RATE} ${params.EPOCHS}"
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: 'model/*', onlyIfSuccessful: true
}
}
}
}