ium_464937/Jenkinsfile

63 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-03-26 17:53:46 +01:00
pipeline {
2024-05-15 00:07:51 +02:00
agent {
dockerfile true
2024-03-26 19:21:06 +01:00
}
2024-05-15 00:07:51 +02:00
triggers {
upstream(upstreamProjects: 's464937-training/training', threshold: hudson.model.Result.SUCCESS)
}
parameters {
buildSelector(defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR')
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'training', name: 'BRANCH', type: 'PT_BRANCH'
}
2024-03-26 17:53:46 +01:00
stages {
2024-05-15 00:07:51 +02:00
stage('Clone Repository') {
2024-03-26 19:21:06 +01:00
steps {
2024-05-15 00:07:51 +02:00
git branch: 'evaluation', url: "https://git.wmi.amu.edu.pl/s464937/ium_464937"
2024-03-26 19:21:06 +01:00
}
}
2024-05-15 00:07:51 +02:00
stage('Copy Dataset Artifacts') {
2024-03-26 19:21:06 +01:00
steps {
2024-05-15 00:07:51 +02:00
copyArtifacts filter: 'data/dev.csv,data/test.csv,data/train.csv', projectName: 'z-s464937-create-dataset', selector: buildParameter('BUILD_SELECTOR')
2024-03-26 19:21:06 +01:00
}
}
2024-05-15 00:07:51 +02:00
stage('Copy Training Artifacts') {
steps {
copyArtifacts filter: 'powerlifting_model.h5', projectName: 's464937-training/' + params.BRANCH, selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Copy Evaluation Artifacts') {
steps {
copyArtifacts filter: 'metrics.txt', projectName: '_s464937-evaluation/evaluation', selector: buildParameter('BUILD_SELECTOR'), optional: true
}
}
stage("Run predictions") {
2024-03-26 17:53:46 +01:00
steps {
2024-05-15 00:07:51 +02:00
sh "chmod +x ./predict.py"
sh "python3 ./predict.py"
archiveArtifacts artifacts: 'powerlifting_test_predictions.csv', onlyIfSuccessful: true
2024-03-26 17:53:46 +01:00
}
}
2024-05-15 00:07:51 +02:00
stage('Run metrics') {
steps {
sh 'chmod +x ./metrics.py'
sh "python3 ./metrics.py ${currentBuild.number}"
}
}
stage('Run plot') {
steps {
sh 'chmod +x ./plot.py'
sh 'python3 ./plot.py'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: '*', onlyIfSuccessful: true
}
}
2024-03-26 17:53:46 +01:00
}
2024-05-15 00:07:51 +02:00
}