From 34e344255274fa463e177e574f708e4a445439d2 Mon Sep 17 00:00:00 2001 From: Kornelia Girejko Date: Fri, 6 May 2022 22:45:59 +0200 Subject: [PATCH] Zaktualizuj 'Jenkinsfile_evaluation' --- Jenkinsfile_evaluation | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile_evaluation b/Jenkinsfile_evaluation index 76fa98d..a959875 100644 --- a/Jenkinsfile_evaluation +++ b/Jenkinsfile_evaluation @@ -18,11 +18,12 @@ pipeline { name: 'KAGGLE_KEY' ) - string( - defaultValue: '1000', - description: 'Number of epochs', - name: 'EPOCHS', - trim: false + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH' + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR' + ) ) } @@ -30,30 +31,37 @@ pipeline { stage('Main'){ steps { - copyArtifacts filter: '*', projectName: 's478815-create-dataset - copyArtifacts filter: '*', projectName: 's478815/master' - copyArtifacts filter: '*', projectName: 's478815-evaluation/master' + copyArtifacts filter: '*', projectName: 's478815-create-dataset, selector: buildParameter('BUILD_SELECTOR') + copyArtifacts filter: '*', projectName: 's478815-training/${BRANCH}', selector: buildParameter('BUILD_SELECTOR') + copyArtifacts filter: '*', projectName: 's478815-evaluation/master', selector: buildParameter('BUILD_SELECTOR'), optional: true sh 'python3 ./evaluation.py' archiveArtifacts artifacts: 'metrics.txt, metrics.png', followSymlinks: false build job: 's478815-evaluation/master/' + + script { + ACC = sh ( + script: 'tail -1 metrics.txt', + returnStdout: true + ).trim() + } } } } post { success { - emailext body: 'SUCCESS', subject: 's478815-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' + emailext body: "SUCCESS, ACC = ${ACC}", subject: 's478815-evaluation', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } failure { - emailext body: 'FAILURE', subject: 's478815-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' + emailext body: 'FAILURE', ACC = ${ACC}", subject: 's478815-evaluation', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } unstable { - emailext body: 'UNSTABLE', subject: 's478815-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' + emailext body: 'UNSTABLE', ACC = ${ACC}", subject: 's478815-evaluation', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } changed { - emailext body: 'CHANGED', subject: 's478815-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' + emailext body: 'CHANGED', ACC = ${ACC}", subject: 's478815-evaluation', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } } } \ No newline at end of file