44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
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
|
|
}
|
|
}
|
|
}
|
|
}
|