Add git build selector
All checks were successful
s444409-evaluation/pipeline/head This commit looks good
s444409-training/pipeline/head This commit looks good

This commit is contained in:
Marcin Kostrzewski 2022-05-05 23:28:25 +02:00
parent 5b2b990ccb
commit a0ccb6e3bd
2 changed files with 18 additions and 3 deletions

View File

@ -4,6 +4,15 @@ pipeline {
image 's444409-create-dataset'
}
}
parameters {
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
environment {
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
@ -17,12 +26,12 @@ pipeline {
}
stage('Get model trend') {
steps {
copyArtifacts projectName: 's444409-training/main/', selector: lastSuccessful(), optional: true
copyArtifacts projectName: "s444409-training/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true
}
}
stage('Get previous trend') {
steps {
copyArtifacts projectName: 's444409-evaluation/main/', selector: lastSuccessful(), optional: true
copyArtifacts projectName: "s444409-evaluation/${params.BRANCH}/", selector: buildParameter('BUILD_SELECTOR'), optional: true
}
}
stage('Evaluate model and write results to file') {

View File

@ -12,6 +12,12 @@ pipeline {
name: 'EPOCHS',
trim: true
)
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
agent {
@ -29,7 +35,7 @@ pipeline {
stage('Archive model and evaluate it') {
steps {
archiveArtifacts artifacts: 'model_out', onlyIfSuccessful: true
build job: 's444409-evaluation/main/'
build job: "s444409-evaluation/${params.BRANCH}/"
}
}
}