ium_464953/.ipynb_checkpoints/Jenkinsfile-checkpoint

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-05-09 00:06:02 +02:00
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: '/app/model.pkl', onlyIfSuccessful: true
}
}
}
}