diff --git a/be/be-acp/ci-acp-backend.Jenkinsfile b/be/be-acp/ci-acp-backend.Jenkinsfile index 25fa2b9..c12aa88 100644 --- a/be/be-acp/ci-acp-backend.Jenkinsfile +++ b/be/be-acp/ci-acp-backend.Jenkinsfile @@ -310,6 +310,13 @@ void publishProject(String buildPath, String publishFolderPath) { void compressItems(String compressedFilePath, String parentFolderPath) { echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}" try { + if (fileExists(compressedFilePath)) { + echo "Old ZIP file exists. Deleting: ${compressedFilePath}" + sh "rm -f ${compressedFilePath}" + } else { + echo 'No old ZIP file found.' + } + if (!fileExists(parentFolderPath)) { error "parentFolderPath is not exist : ${parentFolderPath}" } diff --git a/be/be-portal/ci-portal-backend.Jenkinsfile b/be/be-portal/ci-portal-backend.Jenkinsfile index cb423cd..45f93a2 100644 --- a/be/be-portal/ci-portal-backend.Jenkinsfile +++ b/be/be-portal/ci-portal-backend.Jenkinsfile @@ -130,7 +130,7 @@ pipeline { } script { try { - build job: "${TRIGGER_JOB_NAME}", parameters:[ + build job: "${TRIGGER_JOB_NAME}", parameters:[ string(name: 'ENV', value: 'uat'), string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER) ], propagate: false @@ -310,6 +310,13 @@ void publishProject(String buildPath, String publishFolderPath) { void compressItems(String compressedFilePath, String parentFolderPath) { echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}" try { + if (fileExists(compressedFilePath)) { + echo "Old ZIP file exists. Deleting: ${compressedFilePath}" + sh "rm -f ${compressedFilePath}" + } else { + echo 'No old ZIP file found.' + } + if (!fileExists(parentFolderPath)) { error "parentFolderPath is not exist : ${parentFolderPath}" } diff --git a/fe/fe-acp/ci-prod-acp-frontend.Jenkinsfile b/fe/fe-acp/ci-prod-acp-frontend.Jenkinsfile index 373ebb0..a06fd8e 100644 --- a/fe/fe-acp/ci-prod-acp-frontend.Jenkinsfile +++ b/fe/fe-acp/ci-prod-acp-frontend.Jenkinsfile @@ -196,6 +196,13 @@ void buildProject(String buildFolderPath, String command) { void compressItems(String compressedFilePath, String parentFolderPath) { echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}" try { + if (fileExists(compressedFilePath)) { + echo "Old ZIP file exists. Deleting: ${compressedFilePath}" + sh "rm -f ${compressedFilePath}" + } else { + echo 'No old ZIP file found.' + } + if (!fileExists(parentFolderPath)) { error "parentFolderPath is not exist : ${parentFolderPath}" } diff --git a/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile b/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile index de6de19..3f935b5 100644 --- a/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile +++ b/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile @@ -199,6 +199,13 @@ void buildProject(String buildFolderPath, String command) { void compressItems(String compressedFilePath, String parentFolderPath) { echo "Starting compression of the entire folder into a zip file : ${compressedFilePath}" try { + if (fileExists(compressedFilePath)) { + echo "Old ZIP file exists. Deleting: ${compressedFilePath}" + sh "rm -f ${compressedFilePath}" + } else { + echo 'No old ZIP file found.' + } + if (!fileExists(parentFolderPath)) { error "parentFolderPath is not exist : ${parentFolderPath}" }