2022-05-03 22:12:13 +02:00
|
|
|
pipeline {
|
2022-05-06 17:08:30 +02:00
|
|
|
agent {
|
|
|
|
dockerfile true
|
2022-05-03 22:12:13 +02:00
|
|
|
}
|
2022-05-07 11:28:20 +02:00
|
|
|
|
|
|
|
parameters{
|
|
|
|
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
|
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR'
|
|
|
|
)
|
2022-05-03 22:12:13 +02:00
|
|
|
}
|
2022-05-07 11:28:20 +02:00
|
|
|
|
2022-05-03 22:12:13 +02:00
|
|
|
stages {
|
2022-05-06 17:08:30 +02:00
|
|
|
stage('Copy prev build artifact') {
|
2022-05-03 22:12:13 +02:00
|
|
|
steps {
|
2022-05-06 17:08:30 +02:00
|
|
|
script {
|
|
|
|
if (currentBuild.previousBuild) {
|
|
|
|
try {
|
|
|
|
copyArtifacts(projectName: currentBuild.projectName,
|
|
|
|
selector: specific("${currentBuild.previousBuild.number}"))
|
|
|
|
def previousFile = readFile(file: "TRAIN_winequality-red.csv")
|
|
|
|
echo("The current build is ${currentBuild.number}")
|
|
|
|
echo("The previous build artifact was: ${previousFile}")
|
|
|
|
} catch(err) {
|
|
|
|
// ignore error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-03 22:12:13 +02:00
|
|
|
}
|
|
|
|
}
|
2022-05-06 17:08:30 +02:00
|
|
|
stage('Copy') {
|
2022-05-03 22:12:13 +02:00
|
|
|
steps {
|
2022-05-06 17:08:30 +02:00
|
|
|
copyArtifacts projectName: 's444354-create-dataset'
|
2022-05-07 11:59:39 +02:00
|
|
|
copyArtifacts projectName: "s444354-training/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true
|
2022-05-06 17:08:30 +02:00
|
|
|
sh 'python3 ./evaluation.py'
|
2022-05-07 05:21:27 +02:00
|
|
|
archiveArtifacts 'eval.csv, metrics.png'
|
2022-05-07 11:46:23 +02:00
|
|
|
|
|
|
|
script {
|
|
|
|
metric = sh (
|
|
|
|
script: 'tail -1 eval.csv',
|
|
|
|
returnStdout: true
|
|
|
|
).trim()
|
|
|
|
}
|
2022-05-07 04:46:30 +02:00
|
|
|
|
2022-05-03 22:12:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
2022-05-07 11:46:23 +02:00
|
|
|
emailext body: "${currentBuild.currentResult}, metrics of MAE, MSE, RMSE: ${metric}", subject: '444354-evaluation build status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
2022-05-03 22:12:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|