From fb1007288b563d1535fe58b5f25c7d2bfcf09924 Mon Sep 17 00:00:00 2001 From: s444417 Date: Tue, 3 May 2022 22:54:23 +0200 Subject: [PATCH] copy artifact --- Jenkinsfile.eval | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.eval b/Jenkinsfile.eval index 60adb61..6c8acf3 100644 --- a/Jenkinsfile.eval +++ b/Jenkinsfile.eval @@ -3,12 +3,29 @@ pipeline { dockerfile true } 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-training/master' - sh "ls -la" sh 'python3 ./src/evalScript.py' archiveArtifacts 'trainResults.csv' + sh "ls -la" } } }