ium_464953/Jenkinsfile
2024-05-09 00:24:27 +02:00

40 lines
1.4 KiB
Groovy

pipeline {
agent any
triggers {
upstream(upstreamProjects: 'z-s464953-create-dataset', threshold: hudson.model.Result.SUCCESS)
}
parameters {
string(name: 'TEST_SIZE', defaultValue: '0.10', description: 'Size of test dataset')
string(name: 'MAX_ITER', defaultValue: '1000', description: 'Max number of iterations')
buildSelector(defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR')
}
stages {
stage('Clone Repository') {
steps {
git branch: 'training', url: 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git'
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: 'artifacts/*', projectName: 'z-s464953-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage("Run Docker") {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "python3 /app/model_creator.py ${params.TEST_SIZE} ${params.MAX_ITER}"
archiveArtifacts artifacts: 'model.pkl', onlyIfSuccessful: true
}
}
}
}