changing parsing method

This commit is contained in:
Roberto Cirillo 2022-04-27 12:35:18 +02:00
parent 5ee7960520
commit e7677ab8b2
1 changed files with 19 additions and 1 deletions

20
Jenkinsfile vendored
View File

@ -62,7 +62,7 @@ pipeline {
echo 'Cron build enabled. Deploy from system ongoing'
script {
// parse the report and extract the data
def components = parseDeployComponent(deployList)
def components = parseCSVList(deployList)
assert 0 < components.size(): "No component found"
for (component in components) {
println "$component"
@ -156,3 +156,21 @@ def parseDeployComponent(def deployList) {
return components
}
def parseCSVList(def deployList) {
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
}
}
} else {
echo ' File Not found. Failing.'
}
}