small change

This commit is contained in:
Roberto Cirillo 2022-10-04 10:14:38 +02:00
parent fa0928823d
commit 99d8a90706
1 changed files with 17 additions and 3 deletions

20
Jenkinsfile vendored
View File

@ -109,7 +109,7 @@ pipeline {
def deployFolder="CD-${env.BUILD_NUMBER}";
println ("searching files in folder ${deployFolder}");
def files = findFiles(glob: "${deployFolder}/*.csv")
if (files.isEmpty()){
if (files == null){
println ("Nothing to do");
}else{
for (def file : files){
@ -127,9 +127,10 @@ pipeline {
deploy(record.get(0), record.get(1), record.get(2));
}
}
}
}
clean(${file.path});
}
cleanup(DEPLOY_FILE,BACKUP_FILE);
}
@ -307,6 +308,19 @@ def cleanup(def DEPLOY_FILE, def BACKUP_FILE){
'''
}
/clean and update the local deploy file
def clean(def DEPLOY_FILE){
sh '''
echo "cleanup $DEPLOY_FILE";
if [ -f ${DEPLOY_FILE} ]; then
rm ${DEPLOY_FILE};
else
echo "deploy file empty"
fi
'''
}
//experimental test
def getComponentsFromCSVDir4(def dirPath){
sh '''