Fix for saving metrics
This commit is contained in:
parent
a236f78f2e
commit
fc177a5f14
@ -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
17
save_metrics.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user