generated from gCubeCI/Pipeline-Docker-Template
add script function
This commit is contained in:
parent
f48fbfc448
commit
3c928cd070
|
@ -105,7 +105,7 @@ pipeline {
|
|||
// parse the report and extract the data
|
||||
// def components = getComponentsFromCSV(deployList)
|
||||
println "Going to check the deploy file in ${DEPLOY_FILE_ROOT_FOLDER}"
|
||||
def components =getComponentsFromCSVDir("${WORKSPACE}/CD")
|
||||
def components =getComponentsFromCSVDir4("${WORKSPACE}/CD")
|
||||
if (components.size() > 0) {
|
||||
def componentSet=components.toSet();
|
||||
for (component in componentSet) {
|
||||
|
@ -381,6 +381,24 @@ def getComponentsFromCSVDir3(def dirPath){
|
|||
// }
|
||||
}
|
||||
|
||||
def getComponentsFromCSVDir4(def dirPath){
|
||||
sh '''
|
||||
echo "parsing $dirPath";
|
||||
for entry in `ls $dirPath`; do
|
||||
INPUT=$entry
|
||||
OLDIFS=$IFS
|
||||
IFS=','
|
||||
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
|
||||
while read componentname version
|
||||
do
|
||||
echo "Name : $componentname"
|
||||
echo "DOB : $version"
|
||||
done < $INPUT
|
||||
IFS=$OLDIFS
|
||||
done
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue