fix parseCSV function

This commit is contained in:
Roberto Cirillo 2022-04-27 12:44:51 +02:00
parent e7677ab8b2
commit 49b7269935
1 changed files with 11 additions and 5 deletions

16
Jenkinsfile vendored
View File

@ -157,20 +157,26 @@ def parseDeployComponent(def deployList) {
}
def parseCSVList(def deployList) {
def components = []
if (fileExists("${deployList}")) {
echo ' file found'
readFile("${deployList}").split('\n').each { line, count->
def fields = line.split(',')
for(String item: fields) {
println item
println ' you are parsing line : ' + count
}
components.add([
name : fields[0],
version : fields[1]
]
)
// for(String item: fields) {
// println item
// println ' you are parsing line : ' + count
// }
}
} else {
echo ' File Not found. Failing.'
}
return components
}