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 10:56:26 +02:00
|
|
|
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
|
|
|
|
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 10:58:21 +02:00
|
|
|
copyArtifacts projectName: 's444417-training/${params.BRANCH}'
|
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-03 22:54:23 +02:00
|
|
|
sh "ls -la"
|
2022-05-03 21:45:42 +02:00
|
|
|
}
|
|
|
|
}
|
2022-05-03 20:47:24 +02:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
emailext body: "${currentBuild.currentResult}", subject: 's444417-evaluation build status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|