From 2c28e8b60d6eacab018e993651e3f02b719ded2c Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Tue, 26 Apr 2022 16:04:34 +0200 Subject: [PATCH] fix parsing function --- Jenkinsfile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 71da9f9..1f24782 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -149,8 +149,8 @@ def parseDeployComponent(def deployList) { println "Going to parsing file ${deployList}" def components = [] "${deployList}".splitEachLine(',') { columns -> -// if (columns[0].startsWith('#') || columns[0].startsWith('Component')) -// return + if (columns[0].startsWith('#') || columns[0].startsWith('Component')) + return components.add([ name : columns[1], version : columns[2] @@ -159,3 +159,21 @@ def parseDeployComponent(def deployList) { } 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 +} \ No newline at end of file