ium_444417/Jenkinsfile.eval
s444417 13aa933d27
Some checks failed
s444417-training/pipeline/head This commit looks good
s444417-evaluation/pipeline/head There was a failure building this commit
add build selector
2022-05-07 10:56:26 +02:00

46 lines
1.6 KiB
Plaintext

pipeline {
agent {
dockerfile true
}
parameters{
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', 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: "trainResults.csv")
echo("The current build is ${currentBuild.number}")
echo("The previous build artifact was: ${previousFile}")
} catch(err) {
// ignore error
}
}
}
}
}
stage('Copy') {
steps {
copyArtifacts projectName: 's444417-create-dataset'
copyArtifacts projectName: 's444417-training/$BRANCH'
sh 'python3 ./src/evalScript.py'
archiveArtifacts 'trainResults.csv'
sh "ls -la"
}
}
}
post {
always {
emailext body: "${currentBuild.currentResult}", subject: 's444417-evaluation build status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
}
}