fix parsing function

This commit is contained in:
Roberto Cirillo 2022-04-26 16:04:34 +02:00
parent 8c9124ba4a
commit 2c28e8b60d
1 changed files with 20 additions and 2 deletions

22
Jenkinsfile vendored
View File

@ -149,8 +149,8 @@ def parseDeployComponent(def deployList) {
println "Going to parsing file ${deployList}" println "Going to parsing file ${deployList}"
def components = [] def components = []
"${deployList}".splitEachLine(',') { columns -> "${deployList}".splitEachLine(',') { columns ->
// if (columns[0].startsWith('#') || columns[0].startsWith('Component')) if (columns[0].startsWith('#') || columns[0].startsWith('Component'))
// return return
components.add([ components.add([
name : columns[1], name : columns[1],
version : columns[2] version : columns[2]
@ -159,3 +159,21 @@ def parseDeployComponent(def deployList) {
} }
return components return components
} }
//a non CPS method is necessary for the usage of splitEachLine()
@NonCPS
def parseBuildCommits(def text) {
def components = []
"${text}".splitEachLine(',') { columns ->
if (columns[0].startsWith('#') || columns[0].startsWith('GroupID'))
return
components.add([
name : columns[1],
version : columns[2],
gitRepo : columns[3],
commitID: columns[4]
]
)
}
return components
}