ium_464953/.ipynb_checkpoints/Jenkinsfile-checkpoint

44 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-05-09 01:56:58 +02:00
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-training/' + params.BRANCH, selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Run Script') {
steps {
sh "python3 /app/use_model.py ${currentBuild.number}"
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: '*', onlyIfSuccessful: true
}
}
}
}