ium_444417/Jenkinsfile.eval

49 lines
1.8 KiB
Plaintext
Raw Normal View History

2022-05-03 20:47:24 +02:00
pipeline {
2022-05-03 22:12:57 +02:00
agent {
dockerfile true
}
2022-05-04 15:54:17 +02:00
parameters{
2022-05-07 11:15:37 +02:00
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
2022-05-07 11:14:13 +02:00
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
2022-05-04 15:54:17 +02:00
}
2022-05-03 20:47:24 +02:00
stages {
2022-05-03 22:54:23 +02:00
stage('Copy prev build artifact') {
steps {
script {
if (currentBuild.previousBuild) {
try {
copyArtifacts(projectName: currentBuild.projectName,
selector: specific("${currentBuild.previousBuild.number}"))
def previousFile = readFile(file: "trainResults.csv")
echo("The current build is ${currentBuild.number}")
echo("The previous build artifact was: ${previousFile}")
} catch(err) {
// ignore error
}
}
}
}
}
2022-05-03 20:47:24 +02:00
stage('Copy') {
steps {
2022-05-04 16:49:47 +02:00
copyArtifacts projectName: 's444417-create-dataset'
2022-05-07 11:14:13 +02:00
copyArtifacts projectName: "s444417-training/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true
2022-05-03 22:16:47 +02:00
sh 'python3 ./src/evalScript.py'
2022-05-03 21:45:42 +02:00
archiveArtifacts 'trainResults.csv'
2022-05-07 12:00:05 +02:00
metric = sh (
script: 'trainResults.csv',
returnStdout: true
).trim()
2022-05-07 11:56:13 +02:00
}
}
2022-05-03 20:47:24 +02:00
}
post {
always {
2022-05-07 11:56:13 +02:00
emailext body: "${currentBuild.currentResult}, (number, loss): ${metric}", subject: 's444417-evaluation build status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-03 20:47:24 +02:00
}
}
}