55 lines
1.9 KiB
Plaintext
55 lines
1.9 KiB
Plaintext
pipeline {
|
|
agent {
|
|
dockerfile true
|
|
}
|
|
|
|
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'
|
|
)
|
|
}
|
|
|
|
stages {
|
|
stage('Copy prev build artifact') {
|
|
steps {
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Copy') {
|
|
steps {
|
|
//copyArtifacts projectName: 's444354-create-dataset'
|
|
copyArtifacts projectName: "s444354-training/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true
|
|
sh 'python3 ./evaluation.py'
|
|
archiveArtifacts 'eval.csv, metrics.png'
|
|
|
|
script {
|
|
metric = sh (
|
|
script: 'tail -1 eval.csv',
|
|
returnStdout: true
|
|
).trim()
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
emailext body: "${currentBuild.currentResult}, metrics of MAE, MSE, RMSE: ${metric}", subject: '444354-evaluation build status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
|
}
|
|
}
|
|
} |