From 6abc67535a273861d61436480adb8fe74f102438 Mon Sep 17 00:00:00 2001 From: s452111 Date: Tue, 21 Apr 2020 22:40:42 +0200 Subject: [PATCH] Task 3 - metrics - starting point --- Jenkinsfile | 3 +++ metrics_service.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 metrics_service.sh diff --git a/Jenkinsfile b/Jenkinsfile index 035501f..ec4b8af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,11 +21,14 @@ pipeline { steps { sh 'chmod +x ./service.sh' sh './service.sh' + sh 'chmod +x ./metrics_service.sh' + sh './metrics_service.sh' } } stage('Archive artifacts') { steps { archiveArtifacts 'lines_count.txt' + archiveArtifacts 'wikiniews_results.tsv' } } } diff --git a/metrics_service.sh b/metrics_service.sh new file mode 100644 index 0000000..32dee9d --- /dev/null +++ b/metrics_service.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Prepare hypothesis file based on column 2 +cut -f2 'wikiniews_results.tsv' > hypothesis.txt +# Prepare reference file based on column 3 +cut -f3 'wikiniews_results.tsv' > reference.txt + +# awk transfer txt to .trn +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < referencje.txt > reference.trn +awk 'BEGIN{FS=OFS="\t"}{print $0,"(sp1_"NR")"}' < hipotezy.txt > hypothesis.trn