IUM_06 - add gitParameter and buildSelector in evaluation/Jenkinsfile

This commit is contained in:
Paweł Łączkowski 2024-04-19 12:26:46 +02:00
parent f3f6ab7dee
commit 58f8bb96c0

View File

@ -1,6 +1,20 @@
pipeline {
agent any
parameters {
gitParameter(
branchFilter: 'origin/(.*)',
defaultValue: 'origin/main',
description: 'Branch to build',
name: 'BRANCH'
)
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Build to extract artifacts from',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Clone repository') {
steps {
@ -17,7 +31,11 @@ pipeline {
}
steps {
copyArtifacts(projectName: 's464863-training/main', filter: 'models/model.pth', selector: lastSuccessful())
def projectName = "s464863-training/${params.BRANCH}".replace('origin/', '')
echo "Project name: ${projectName}"
def projectName2 = "z-s464863-create-dataset/${params.BRANCH}"
echo "Project name: ${projectName2}"
copyArtifacts(projectName: projectName, filter: 'models/model.pth', selector: buildParameter('BUILD_SELECTOR'))
copyArtifacts(projectName: 'z-s464863-create-dataset', filter: 'datasets/test.csv', selector: lastSuccessful())
copyArtifacts(projectName: 's464863-evaluation/main', filter: 'metrics.csv', selector: lastSuccessful(), optional: true)
}