From 5fdd44cf5cf68dd558775245698ac041c7bbd9e0 Mon Sep 17 00:00:00 2001 From: Artur Nowakowski Date: Fri, 3 Apr 2020 13:24:34 +0200 Subject: [PATCH] Accumulate results --- Jenkinsfile | 19 ++++++++++++++----- append_to_file.sh | 4 ++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100755 append_to_file.sh diff --git a/Jenkinsfile b/Jenkinsfile index 7373976..d67d42d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,15 +20,24 @@ pipeline { stage('Count metrics'){ steps{ sh label: '', script: './count_metrics.sh wikiniews_results.tsv' + } + } + stage('Accumulate metrics results'){ + steps{ + copyArtifacts filter: 'srr.txt, wer.txt', fingerprintArtifacts: true, optional: true, projectName: 's416138-metrics', target: 'last-results' + if(fileExists('last-results/srr.txt') && fileExists('last-results/wer.txt')){ + sh label: '', script: './append_to_file.sh last-results/srr.txt srr.txt' + sh label: '', script: './append_to_file.sh last-results/wer.txt wer.txt' + } + } + } + stage('Archive results'){ + steps{ + archiveArtifacts 'counted_lines.txt' archiveArtifacts 'srr.txt' archiveArtifacts 'wer.txt' archiveArtifacts 'wikiniews_results_with_wer.tsv' } } - stage('Archive results'){ - steps{ - archiveArtifacts 'counted_lines.txt' - } - } } } diff --git a/append_to_file.sh b/append_to_file.sh new file mode 100755 index 0000000..41055df --- /dev/null +++ b/append_to_file.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mv $1 $1.last +tail -1000 $1.last >> $2 \ No newline at end of file