diff --git a/Jenkinsfile_eval b/Jenkinsfile_eval index a36df1e..c3a1952 100644 --- a/Jenkinsfile_eval +++ b/Jenkinsfile_eval @@ -26,7 +26,7 @@ pipeline { } stage('Save metrics to bulk file & create chart') { 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' sh "python3 create_chart.py" archiveArtifacts 'chart.png' diff --git a/save_metrics.py b/save_metrics.py new file mode 100644 index 0000000..8b73920 --- /dev/null +++ b/save_metrics.py @@ -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)