add plot and new jenkinsfile

This commit is contained in:
Klaudia 2023-05-11 19:50:42 +02:00
parent 4cc01ac4ef
commit 6e712babdb
2 changed files with 72 additions and 0 deletions

62
Jenkinsfile_evaluation Normal file
View File

@ -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_z444439/plot.py'
archiveArtifacts 'prediction.csv'
archiveArtifacts 'metrics.csv'
archiveArtifacts 'metrics.png'
}
}
stage('clear_after') {
steps {
sh 'rm -rf *'
}
}
}
}

10
plot.py Normal file
View File

@ -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')