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

@ -5,6 +5,15 @@ pipeline {
} }
} }
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 { environment {
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
} }
@ -17,12 +26,12 @@ pipeline {
} }
stage('Get model trend') { stage('Get model trend') {
steps { 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') { stage('Get previous trend') {
steps { 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') { stage('Evaluate model and write results to file') {

View File

@ -12,6 +12,12 @@ pipeline {
name: 'EPOCHS', name: 'EPOCHS',
trim: true 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 { agent {
@ -29,7 +35,7 @@ pipeline {
stage('Archive model and evaluate it') { stage('Archive model and evaluate it') {
steps { steps {
archiveArtifacts artifacts: 'model_out', onlyIfSuccessful: true archiveArtifacts artifacts: 'model_out', onlyIfSuccessful: true
build job: 's444409-evaluation/main/' build job: "s444409-evaluation/${params.BRANCH}/"
} }
} }
} }