Fix for saving metrics
Some checks failed
s434704-training/pipeline/head This commit looks good
s434704-evaluation/pipeline/head There was a failure building this commit

This commit is contained in:
Wojciech Jarmosz 2021-05-14 22:26:47 +02:00
parent a236f78f2e
commit fc177a5f14
2 changed files with 18 additions and 1 deletions

View File

@ -26,7 +26,7 @@ pipeline {
} }
stage('Save metrics to bulk file & create chart') { stage('Save metrics to bulk file & create chart') {
steps{ steps{
sh "if [ -f "rmse.txt" ]; "${env.BUILD_ID} ${cat rmse.txt}" >> bulk_metrics.txt fi" sh "python3 save_metrics.py ${env.BUILD_ID}"
archiveArtifacts 'bulk_metrics.txt' archiveArtifacts 'bulk_metrics.txt'
sh "python3 create_chart.py" sh "python3 create_chart.py"
archiveArtifacts 'chart.png' archiveArtifacts 'chart.png'

17
save_metrics.py Normal file
View File

@ -0,0 +1,17 @@
import os.path
import sys
import os.path
arguments = sys.argv[1:]
build_no = arguments[0]
result = ""
if os.path.exists("rmse.txt"):
with open("rmse.txt", "r") as file:
for line in file.readlines():
result = line
with open("bulk_metrics.txt", "a") as file:
file.write(result)