From c1a755c477b62b3dacffca117d40b6d00a56b065 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Sun, 4 May 2025 14:00:34 +0300 Subject: [PATCH] zip update --- build/jenkins/zip | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/build/jenkins/zip b/build/jenkins/zip index f59fe6e..dfd8179 100644 --- a/build/jenkins/zip +++ b/build/jenkins/zip @@ -166,7 +166,7 @@ pipeline { // Read the zip filename from the temporary file def createdZipFilename = "" - def tempFilenameFile = "zip_filename.txt" // Must match the name used in PowerShell + // Removed the duplicate declaration of tempFilenameFile here. try { echo "Attempting to read zip filename from temporary file: ${tempFilenameFile}" @@ -177,22 +177,13 @@ pipeline { echo "Warning: Temporary filename file '${tempFilenameFile}' not found. Zip creation might have failed." } finally { // Clean up the temporary file - echo "Cleaning up temporary filename file: ${tempFilenameFile}" - deleteDir() // Use deleteDir() to remove files/dirs in the current dir block - // Or more specifically: fileOperations([genSandboxConfig: true, operations: [[excludes: null, includes: tempFilenameFile, pattern: null, type: 'DELETE']]]) - // Let's use deleteDir() within the dir block for simplicity here. Note: deleteDir() removes everything in the current dir block. - // A more targeted approach might be needed if other files must persist. - // For now, let's assume it's safe to clean the entire dir block. - // Wait, deleteDir() is too aggressive. Let's use the fileOperations step. - } - - // Re-implementing cleanup using fileOperations - try { - echo "Cleaning up temporary filename file: ${tempFilenameFile} using fileOperations" - fileOperations([genSandboxConfig: true, operations: [[excludes: null, includes: tempFilenameFile, pattern: null, type: 'DELETE']]]) - echo "Temporary filename file cleaned up." - } catch (Exception e) { - echo "Warning: Failed to clean up temporary filename file '${tempFilenameFile}': ${e.getMessage()}" + try { + echo "Cleaning up temporary filename file: ${tempFilenameFile} using fileOperations" + fileOperations([genSandboxConfig: true, operations: [[excludes: null, includes: tempFilenameFile, pattern: null, type: 'DELETE']]]) + echo "Temporary filename file cleaned up." + } catch (Exception e) { + echo "Warning: Failed to clean up temporary filename file '${tempFilenameFile}': ${e.getMessage()}" + } }