From 16a903b943b5ed91e840c45eb8876809ca263827 Mon Sep 17 00:00:00 2001 From: thienqb123456 Date: Mon, 6 Jan 2025 10:00:55 +0700 Subject: [PATCH] =?UTF-8?q?Thienvv=20-=20x=C3=B3a=20file=20n=C3=A9n=20c?= =?UTF-8?q?=C5=A9=20tr=C6=B0=E1=BB=9Bc=20khi=20n=C3=A9n=20file=20m?= =?UTF-8?q?=E1=BB=9Bi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/be-acp/ci-acp-backend.Jenkinsfile | 7 +++++++ be/be-portal/ci-portal-backend.Jenkinsfile | 9 ++++++++- fe/fe-acp/ci-prod-acp-frontend.Jenkinsfile | 7 +++++++ fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) 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}" }