generated from gCubeCI/Pipeline-Docker-Template
changing parsing method
This commit is contained in:
parent
5ee7960520
commit
e7677ab8b2
|
@ -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.'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue