From 40e2d5bc3cca69582f09d585eded2716b0bab1ae Mon Sep 17 00:00:00 2001 From: Klaudia Date: Thu, 11 May 2023 19:46:19 +0200 Subject: [PATCH] add plot and new jenkinsfile --- Jenkinsfile_evaluation | 62 ++++++++++++++++++++++++++++++++++++++++++ plot.py | 10 +++++++ 2 files changed, 72 insertions(+) create mode 100644 Jenkinsfile_evaluation create mode 100644 plot.py diff --git a/Jenkinsfile_evaluation b/Jenkinsfile_evaluation new file mode 100644 index 0000000..f15d2b7 --- /dev/null +++ b/Jenkinsfile_evaluation @@ -0,0 +1,62 @@ +pipeline { + agent any + parameters{ + string( + defaultValue: 'master', + description: 'BRANCH', + name: 'BRANCH', + trim: false + ) + } + stages { + stage('Clear_Before') { + steps { + sh 'rm -rf *' + } + } + stage('Clone') { + steps { + sh 'git clone https://git.wmi.amu.edu.pl/s444439/ium_z444439' + } + } + stage('copy_artifacts_from_training') { + steps { + copyArtifacts(projectName: 'z-s444439-training/master', fingerprintArtifacts: true) + } + } + stage('copy_artifacts_from_evaluation') { + steps { + copyArtifacts(projectName: 'z-s444439-evaluation/master', fingerprintArtifacts: true, optional: true) + } + } + stage('copy_artifacts_test') { + steps { + copyArtifacts(projectName: 'z-s444439-create-dataset', filter: 'X_test.csv,Y_test.csv', fingerprintArtifacts: true) + } + } + stage('Docker') { + agent { + dockerfile { + filename 'Dockerfile' + dir 'ium_z444439' + reuseNode true + } + } + steps { + sh 'ls -a' + sh 'python ./ium_z444439/prediction.py' + sh 'python ./ium_z434686/plot.py' + archiveArtifacts 'prediction.csv' + archiveArtifacts 'metrics.csv' + archiveArtifacts 'metrics.png' + } + } + + + stage('clear_after') { + steps { + sh 'rm -rf *' + } + } + } +} \ No newline at end of file diff --git a/plot.py b/plot.py new file mode 100644 index 0000000..8705e55 --- /dev/null +++ b/plot.py @@ -0,0 +1,10 @@ +import pandas as pd +import matplotlib.pyplot as plt + +metrics = pd.read_csv('./metrics.csv') + +builds = metrics[metrics.columns[0]] +accuracy = metrics[metrics.columns[1]] + +plt.plot(builds, accuracy) +plt.savefig('metrics_.png')