ium_464863/evaluation/Jenkinsfile

59 lines
1.7 KiB
Plaintext
Raw Normal View History

pipeline {
agent any
parameters {
gitParameter(
branchFilter: 'origin/(.*)',
defaultValue: 'origin/main',
description: 'Branch to build',
2024-04-19 12:34:46 +02:00
name: 'BRANCH',
type: 'PT_BRANCH'
)
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Build to extract artifacts from',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Clone repository') {
steps {
checkout scm
}
}
stage('Copy artifacts') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
2024-04-19 12:31:19 +02:00
script {
2024-04-19 12:34:46 +02:00
def projectName = "s464863-training/${params.BRANCH}"
2024-04-19 12:31:19 +02:00
copyArtifacts(projectName: projectName, filter: 'models/model.pth', selector: buildParameter('BUILD_SELECTOR'))
copyArtifacts(projectName: 'z-s464863-create-dataset', filter: 'datasets/test.csv', selector: lastSuccessful())
copyArtifacts(projectName: 's464863-evaluation/main', filter: 'metrics.csv', selector: lastSuccessful(), optional: true)
}
}
}
stage('Evaluate model') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./predict.py"
sh "python3 ./predict.py"
archiveArtifacts artifacts: 'predictions.csv, metrics.csv, metrics.png', onlyIfSuccessful: true
}
}
}
}