diff --git a/Dockerfile b/Dockerfile index 3189a0a..11de207 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ RUN apt install -y gcc RUN gcc --version RUN apt install -y build-essential RUN apt install -y moreutils -RUN python --version \ No newline at end of file +RUN python --version +RUN pip install matplotlib \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index b15f3b1..84da7b1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,10 @@ pipeline { } stage('Plot') { steps { - sh label: '', script: './plot.py' + sh label: '', script: './plot.py wer.txt wer.png' + sh label: '', script: './plot.py srr.txt srr.png' + archiveArtifacts 'wer.png' + archiveArtifacts 'srr.png' } } } diff --git a/plot.py b/plot.py index 3ac231a..38a46ff 100755 --- a/plot.py +++ b/plot.py @@ -1,7 +1,21 @@ #!/usr/bin/env python +import matplotlib.pyplot as plt +import sys + +def read_file(filename): + values = [] + with open(filename) as f: + for line in f: + values.append(float(line.rstrip('\n'))) + return values + + def main(): - pass + values = read_file(sys.argv[1]) + plt.plot(values) + plt.savefig(sys.argv[2], dpi=1000) + plt.close() if __name__ == "__main__":