ium_464953/Jenkinsfile

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, artifacts/docker_test_dataset.csv', onlyIfSuccessful: true
}
}
}
}