working on folder method

This commit is contained in:
Roberto Cirillo 2022-09-16 10:37:54 +02:00
parent e4a683cbd6
commit 8094698bd1
1 changed files with 18 additions and 2 deletions

20
Jenkinsfile vendored
View File

@ -1,5 +1,5 @@
#!groovy
import groovy.io.FileType
import groovy.io.FileType.*
import static groovy.io.FileType.FILES
/**
* Deploy components to the D4Science Infrastructure (dev-only)
@ -99,7 +99,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 =getComponentsFromCSVDir2("${DEPLOY_FILE_ROOT_FOLDER}")
def components =getComponentsFromCSVDir3("${DEPLOY_FILE_ROOT_FOLDER}")
if (components.size() > 0) {
def componentSet=components.toSet();
for (component in componentSet) {
@ -355,5 +355,21 @@ def getComponentsFromCSVDir2(def dirPath){
return components
}
def getComponentsFromCSVDir3(def dirPath){
println "checking current folder"
dh = new File('.')
dh.eachFileRecurse {
println it
}
println "checking CD folder";
def startDir = new File("/var/lib/jenkins/CD")
startDir.eachFileRecurse(FILES) {
if (it.name.endsWith('.csv')) {
println it
}
}
}