ium_464953/Jenkinsfile

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-03-23 20:49:49 +01:00
pipeline {
agent any
2024-05-09 00:06:02 +02:00
triggers {
upstream(upstreamProjects: 'z-s464953-create-dataset', threshold: hudson.model.Result.SUCCESS)
}
2024-03-23 20:49:49 +01:00
parameters {
2024-05-09 00:06:02 +02:00
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')
2024-03-23 20:49:49 +01:00
}
stages {
stage('Clone Repository') {
steps {
2024-05-09 00:06:02 +02:00
git branch: 'training', url: 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git'
2024-03-23 20:49:49 +01:00
}
}
2024-05-09 00:06:02 +02:00
stage('Copy Artifacts') {
2024-03-25 21:17:08 +01:00
steps {
2024-05-09 00:06:02 +02:00
copyArtifacts filter: 'artifacts/*', projectName: 'z-s464953-create-dataset', selector: buildParameter('BUILD_SELECTOR')
2024-03-25 21:17:08 +01:00
}
}
2024-05-09 00:06:02 +02:00
stage("Run Docker") {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
2024-03-23 20:49:49 +01:00
}
}
steps {
2024-05-09 00:06:02 +02:00
sh "python3 /app/model_creator.py ${params.TEST_SIZE} ${params.MAX_ITER}"
archiveArtifacts artifacts: '/app/model.pkl', onlyIfSuccessful: true
2024-03-23 20:49:49 +01:00
}
}
}
}