From b0f4e521c215aefe98d43b8ff374a38cd7f4e530 Mon Sep 17 00:00:00 2001 From: Karolina Oparczyk Date: Thu, 20 May 2021 20:04:47 +0200 Subject: [PATCH] email --- JenkinsfileEval | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/JenkinsfileEval b/JenkinsfileEval index baefce4..f7ad710 100644 --- a/JenkinsfileEval +++ b/JenkinsfileEval @@ -19,21 +19,34 @@ node { } stage('Clone repo') { - docker.image("karopa/ium:20").inside { - stage('Test') { - checkout([$class: 'GitSCM', branches: [[name: '*/evaluation']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]]) - copyArtifacts fingerprintArtifacts: true, projectName: 's434765-create-dataset', selector: buildParameter("BUILD_DATASET") - copyArtifacts fingerprintArtifacts: true, projectName: 's434765-training/' + params.BRANCH + '/', selector: buildParameter("BUILD_MODEL") - copyArtifacts fingerprintArtifacts: true, projectName: 's434765-evaluation/evaluation/', selector: lastSuccessful() - sh ''' - #!/usr/bin/env bash - chmod 777 evaluate_network.py - python3 evaluate_network.py | tee output.txt - ''' - archiveArtifacts 'output.txt' - archiveArtifacts 'rmse.txt' - archiveArtifacts 'evaluation.png' + try { + docker.image("karopa/ium:20").inside { + + stage('Test') { + checkout([$class: 'GitSCM', branches: [[name: '*/evaluation']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]]) + copyArtifacts fingerprintArtifacts: true, projectName: 's434765-create-dataset', selector: buildParameter("BUILD_DATASET") + copyArtifacts fingerprintArtifacts: true, projectName: 's434765-training/' + params.BRANCH + '/', selector: buildParameter("BUILD_MODEL") + copyArtifacts fingerprintArtifacts: true, projectName: 's434765-evaluation/evaluation/', selector: lastSuccessful() + sh ''' + #!/usr/bin/env bash + chmod 777 evaluate_network.py + python3 evaluate_network.py | tee output.txt + ''' + archiveArtifacts 'output.txt' + archiveArtifacts 'rmse.txt' + archiveArtifacts 'evaluation.png' + } + def data = readFile(file: 'rmse.txt').split("/n") + emailext body: 'Successful evaluation ${data[data.size()]}', + subject: "s434765", + to: "26ab8f35.uam.onmicrosoft.com@emea.teams.ms" } - } + } + catch (e) { + emailext body: 'Failed evaluation', + subject: "s434765", + to: "26ab8f35.uam.onmicrosoft.com@emea.teams.ms" + throw e + } } }