ium_464953/Jenkinsfile
2024-05-09 02:17:29 +02:00

44 lines
1.4 KiB
Groovy

pipeline {
agent {
dockerfile true
}
triggers {
upstream(upstreamProjects: 's464953-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 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git'
}
}
stage('Copy Training Artifacts') {
steps {
copyArtifacts filter: 'artifacts/*', projectName: 's464953-training/' + params.BRANCH, selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Copy Evaluation Artifacts') {
steps {
copyArtifacts filter: 'metrics_df.csv', projectName: '_s464953-evaluation/evaluation', selector: buildParameter('BUILD_SELECTOR'), optional: true
}
}
stage('Run Script') {
steps {
sh "python3 /app/use_model.py ${currentBuild.number}"
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: '*', onlyIfSuccessful: true
}
}
}
}