ium_464913/Jenkinsfile
2024-05-04 16:19:51 +02:00

71 lines
1.8 KiB
Groovy

pipeline {
agent {
dockerfile true
}
triggers {
upstream(upstreamProjects: 's464913-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'
}
stages {
stage('Clone Repository') {
steps {
git branch: 'evaluation', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
}
}
stage('Copy Artifacts from dataset job') {
steps {
copyArtifacts filter: 'data/*', projectName: 'z-s464913-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Copy Artifacts from training job') {
steps {
copyArtifacts filter: 'model/*', projectName: 's464913-training/' + params.BRANCH, selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Copy Artifacts from evaluation job') {
steps {
copyArtifacts filter: 'evaluation/*', projectName: 's464913-evaluation/evaluation', selector: buildParameter('BUILD_SELECTOR'), optional: true
}
}
stage('Run predict script') {
steps {
sh 'chmod +x predict.py'
sh 'python3 ./predict.py'
}
}
stage('Run metrics script') {
steps {
sh 'chmod +x metrics.py'
sh "python3 ./metrics.py ${currentBuild.number}"
}
}
stage('Run plot script') {
steps {
sh 'chmod +x plot.py'
sh 'python3 ./plot.py'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: 'evaluation/*', onlyIfSuccessful: true
}
}
}
}