diff --git a/Jenkinsfile b/Jenkinsfile index 3ad9b2b..30699d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy - +import groovy.io.FileType /** * Deploy components to the D4Science Infrastructure (dev-only) * @@ -119,10 +119,13 @@ pipeline { } stage('Nothing to do ') { when{ - allOf{ - triggeredBy 'TimerTrigger' - environment name: 'IS_CRON', value: 'False' + anyOf{ + allOf{ + triggeredBy 'TimerTrigger' + environment name: 'IS_CRON', value: 'False' + } } + } steps { echo 'Do Nothing: cron build disabled' @@ -282,4 +285,29 @@ def cleanup(def DEPLOY_FILE, def BACKUP_FILE){ echo "deploy file empty" fi ''' +} + +#experimental test + +def getComponentsFromCSVDir(def dirPath){ + File folder = new File(dirPath) + folder.eachFileRecurse FileType.FILES, { file -> + // do nothing if the file ends with a .txt extension + if (file.name.endsWith(".csv")) { + println "Processing file ${file.absolutePath}" + 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] + ] + ) + } + + } + } + return components } \ No newline at end of file