generated from gCubeCI/Pipeline-Docker-Template
add loop on deploy folder
This commit is contained in:
parent
f72d3705fb
commit
3b9e5e1826
|
@ -55,6 +55,7 @@ pipeline {
|
|||
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
|
||||
DEPLOY_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.csv"
|
||||
BACKUP_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.bck"
|
||||
DEPLOY_FOLDER= "${WORKSPACE}/CD-${PIPELINE_BUILD_NUMBER}"
|
||||
TRIGGER_JOB= "${params.TRIGGER_JOB}"
|
||||
TRIGGER_VERSION= "${params.TRIGGER_VERSION}"
|
||||
TRIGGER_HOST="${params.TRIGGER_HOST}"
|
||||
|
@ -103,7 +104,17 @@ pipeline {
|
|||
echo 'Cron build enabled. Deploy from system ongoing'
|
||||
script {
|
||||
println "Going to check the deploy file in ${PENDING_DEPLOY_FOLDER}"
|
||||
def records = readCSV file: 'CD/deploy.csv'
|
||||
// def records = readCSV file: 'CD/deploy.csv'
|
||||
// def files = findFiles(glob: 'target/surefire-reports/*.csv')
|
||||
def deployFolder="CD-${env.BUILD_NUMBER}";
|
||||
println ("searching files in folder ${deployFolder}");
|
||||
def files = findFiles(glob: "CD-${deployFolder}/*.csv")
|
||||
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)){
|
||||
|
@ -115,6 +126,7 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanup(DEPLOY_FILE,BACKUP_FILE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue