fis readCSV method

This commit is contained in:
Roberto Cirillo 2022-10-04 09:56:24 +02:00
parent 5e9c7a1e9f
commit 51b48579ab
1 changed files with 24 additions and 22 deletions

46
Jenkinsfile vendored
View File

@ -109,29 +109,31 @@ pipeline {
def deployFolder="CD-${env.BUILD_NUMBER}";
println ("searching files in folder ${deployFolder}");
def files = findFiles(glob: "${deployFolder}/*.csv")
echo """
Processing: ${files[0].name} ${files[0].path} ${files[0].directory}
${files[0].length} ${files[0].lastModified}
"""
for (def file : files){
echo """
Processing: ${files[0].name} ${files[0].path} ${files[0].directory}
${files[0].length} ${files[0].lastModified}
"""
def records = readCSV file: 'file.path'
for (def record : records) {
println("Processing record: "+record)
stage(record.get(0)){
println "Deploy on going of component: record.get(0)"
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
checkup(record.get(0), record.get(1), record.get(2));
deploy(record.get(0), record.get(1), record.get(2));
}
}
}
}
if (!files.isEmpty()){
for (def file : files){
echo """
Found: ${file.name} with path ${file.path}
length ${files[0].length} lastModified ${files[0].lastModified}
"""
def records = readCSV file: "${file.path}"
for (def record : records) {
println("Processing record: "+record)
stage(record.get(0)){
println "Deploy on going of component: record.get(0)"
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
checkup(record.get(0), record.get(1), record.get(2));
deploy(record.get(0), record.get(1), record.get(2));
}
}
}
}
cleanup(DEPLOY_FILE,BACKUP_FILE);
}else{
println ("Nothing to do");
}
}
cleanup(DEPLOY_FILE,BACKUP_FILE);
}
}
stage('Nothing to do ') {