zip update

This commit is contained in:
dzaitsev
2025-05-04 14:00:34 +03:00
parent 23f9ff16a4
commit c1a755c477
+8 -17
View File
@@ -166,7 +166,7 @@ pipeline {
// Read the zip filename from the temporary file // Read the zip filename from the temporary file
def createdZipFilename = "" def createdZipFilename = ""
def tempFilenameFile = "zip_filename.txt" // Must match the name used in PowerShell // Removed the duplicate declaration of tempFilenameFile here.
try { try {
echo "Attempting to read zip filename from temporary file: ${tempFilenameFile}" 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." echo "Warning: Temporary filename file '${tempFilenameFile}' not found. Zip creation might have failed."
} finally { } finally {
// Clean up the temporary file // Clean up the temporary file
echo "Cleaning up temporary filename file: ${tempFilenameFile}" try {
deleteDir() // Use deleteDir() to remove files/dirs in the current dir block echo "Cleaning up temporary filename file: ${tempFilenameFile} using fileOperations"
// Or more specifically: fileOperations([genSandboxConfig: true, operations: [[excludes: null, includes: tempFilenameFile, pattern: null, type: 'DELETE']]]) 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. echo "Temporary filename file cleaned up."
// A more targeted approach might be needed if other files must persist. } catch (Exception e) {
// For now, let's assume it's safe to clean the entire dir block. echo "Warning: Failed to clean up temporary filename file '${tempFilenameFile}': ${e.getMessage()}"
// 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()}"
} }