generated from gCubeCI/Pipeline-Docker-Template
fix sintax
This commit is contained in:
parent
5c2faa5acd
commit
ed52fdb21e
|
@ -309,91 +309,6 @@ def cleanup(def DEPLOY_FILE, def BACKUP_FILE){
|
|||
}
|
||||
|
||||
//experimental test
|
||||
|
||||
@NonCPS
|
||||
def getComponentsFromCSVDir(def dirPath){
|
||||
File folder = new File(dirPath)
|
||||
// folder= new FilePath(Jenkins.getInstance().getComputer(env['NODE_NAME']).getChannel(), dirPath);
|
||||
println ("folder ready ");
|
||||
if (folder){
|
||||
println (" processing folder "+folder);
|
||||
folder.eachFileRecurse FileType.FILES, { file ->
|
||||
// check it if the file ends with a .csv extension
|
||||
println("checking file: "+file);
|
||||
if (file.name.endsWith(".csv")) {
|
||||
println ("Processing file ");
|
||||
readFile(file).split('\n').each { line, count->
|
||||
if (line.startsWith('#'))
|
||||
return
|
||||
def fields = line.split(',')
|
||||
components.add([
|
||||
name : fields[0],
|
||||
version : fields[1],
|
||||
host : fields[2]
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
println ("removing current deploy file: "+file.name);
|
||||
// remove the file here if possible
|
||||
// file.delete();
|
||||
}
|
||||
}
|
||||
return components
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
def getComponentsFromCSVDir2(def dirPath){
|
||||
def list = []
|
||||
def folder = new File(dirPath)
|
||||
println ("folder ready ");
|
||||
if (folder){
|
||||
println (" processing folder "+folder);
|
||||
folder.eachFileRecurse FileType.FILES, {
|
||||
if (file.name.endsWith(".csv")) {
|
||||
println ("Processing file "+it);
|
||||
list << file
|
||||
readFile(file).split('\n').each { line, count->
|
||||
if (line.startsWith('#'))
|
||||
return
|
||||
def fields = line.split(',')
|
||||
components.add([
|
||||
name : fields[0],
|
||||
version : fields[1],
|
||||
host : fields[2]
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
println ("removing current deploy file: "+it.name);
|
||||
// remove the file here if possible
|
||||
// file.delete();
|
||||
}
|
||||
}
|
||||
println "files to remove:";
|
||||
list.each {
|
||||
println ("removing"+it.path);
|
||||
it.delete();
|
||||
}
|
||||
return components
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
def getComponentsFromCSVDir3(def dirPath){
|
||||
println "checking current folder"
|
||||
dh = new File(dirPath)
|
||||
println "current folder path: "+dh.path
|
||||
dh.eachFileRecurse {
|
||||
println it
|
||||
}
|
||||
println "checking CD folder";
|
||||
// startDir.eachFileRecurse(FILES) {
|
||||
// if (it.name.endsWith('.csv')) {
|
||||
// println it
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
def getComponentsFromCSVDir4(def dirPath){
|
||||
sh '''
|
||||
echo "parsing $dirPath";
|
||||
|
|
Loading…
Reference in New Issue