Fix build scan logic to support folder nested Jenkins job names
Signed-off-by: Mark Vieira <portugee@gmail.com>
This commit is contained in:
parent
05f97d5e1b
commit
56bbed3593
|
@ -37,11 +37,11 @@ buildScan {
|
||||||
// Parse job name in the case of matrix builds
|
// Parse job name in the case of matrix builds
|
||||||
// Matrix job names come in the form of "base-job-name/matrix_param1=value1,matrix_param2=value2"
|
// Matrix job names come in the form of "base-job-name/matrix_param1=value1,matrix_param2=value2"
|
||||||
def splitJobName = jobName.split('/')
|
def splitJobName = jobName.split('/')
|
||||||
if (splitJobName.length == 2) {
|
if (splitJobName.length > 1 && splitJobName.last() ==~ /^([a-zA-Z0-9_\-]+=[a-zA-Z0-9_\-]+,?)+$/) {
|
||||||
tag splitJobName[0]
|
def baseJobName = splitJobName.dropRight(1).join('/')
|
||||||
tag splitJobName[1]
|
tag baseJobName
|
||||||
value 'Job Name', splitJobName[0]
|
value 'Job Name', baseJobName
|
||||||
def matrixParams = splitJobName[1].split(',')
|
def matrixParams = splitJobName.last().split(',')
|
||||||
matrixParams.collect { it.split('=') }.each { param ->
|
matrixParams.collect { it.split('=') }.each { param ->
|
||||||
value "MATRIX_${param[0].toUpperCase()}", param[1]
|
value "MATRIX_${param[0].toUpperCase()}", param[1]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue