From 8efece907735ed10ef3ef3f5f0744f0dba12f286 Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Sat, 7 May 2022 11:28:20 +0200 Subject: [PATCH] branch select parametrization --- Jenkinsfile_evaluation | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile_evaluation b/Jenkinsfile_evaluation index caafd40..edb3429 100644 --- a/Jenkinsfile_evaluation +++ b/Jenkinsfile_evaluation @@ -2,18 +2,16 @@ pipeline { agent { dockerfile true } - parameters{ - string( - defaultValue: 'master', - description: 'training branch name', - name: 'TRAINING_BRANCH' - ) - password( - defaultValue: '', - description: 'JENKINS password', - name: 'JENKINS_KEY' - ) + + parameters{ + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH' + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR' + ) } + stages { stage('Copy prev build artifact') { steps { @@ -35,7 +33,7 @@ pipeline { stage('Copy') { steps { copyArtifacts projectName: 's444354-create-dataset' - copyArtifacts projectName: 's444354-training/$TRAINING_BRANCH' + copyArtifacts projectName: "s444417-training/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true sh 'python3 ./evaluation.py' archiveArtifacts 'eval.csv, metrics.png'