diff --git a/Jenkinsfile b/Jenkinsfile index 056f6c7..b23ead2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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.' + } + +} + +