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}"
|
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
|
||||||
DEPLOY_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.csv"
|
DEPLOY_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.csv"
|
||||||
BACKUP_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.bck"
|
BACKUP_FILE = "${PENDING_DEPLOY_FOLDER}deploy.${PIPELINE_BUILD_NUMBER}.bck"
|
||||||
|
DEPLOY_FOLDER= "${WORKSPACE}/CD-${PIPELINE_BUILD_NUMBER}"
|
||||||
TRIGGER_JOB= "${params.TRIGGER_JOB}"
|
TRIGGER_JOB= "${params.TRIGGER_JOB}"
|
||||||
TRIGGER_VERSION= "${params.TRIGGER_VERSION}"
|
TRIGGER_VERSION= "${params.TRIGGER_VERSION}"
|
||||||
TRIGGER_HOST="${params.TRIGGER_HOST}"
|
TRIGGER_HOST="${params.TRIGGER_HOST}"
|
||||||
|
@ -103,17 +104,28 @@ pipeline {
|
||||||
echo 'Cron build enabled. Deploy from system ongoing'
|
echo 'Cron build enabled. Deploy from system ongoing'
|
||||||
script {
|
script {
|
||||||
println "Going to check the deploy file in ${PENDING_DEPLOY_FOLDER}"
|
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'
|
||||||
for (def record : records) {
|
// def files = findFiles(glob: 'target/surefire-reports/*.csv')
|
||||||
println("Processing record: "+record)
|
def deployFolder="CD-${env.BUILD_NUMBER}";
|
||||||
stage(record.get(0)){
|
println ("searching files in folder ${deployFolder}");
|
||||||
println "Deploy on going of component: record.get(0)"
|
def files = findFiles(glob: "CD-${deployFolder}/*.csv")
|
||||||
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
|
for (def file : files){
|
||||||
checkup(record.get(0), record.get(1), record.get(2));
|
echo """
|
||||||
deploy(record.get(0), record.get(1), record.get(2));
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanup(DEPLOY_FILE,BACKUP_FILE);
|
cleanup(DEPLOY_FILE,BACKUP_FILE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue