ium_464913/Jenkinsfile
2024-05-04 15:25:54 +02:00

57 lines
1.3 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'
)
}
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/training', selector: buildParameter('BUILD_SELECTOR')
}
}
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'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: 'evaluation/*', onlyIfSuccessful: true
}
}
}
}