zip update

This commit is contained in:
dzaitsev
2025-05-04 14:04:15 +03:00
parent 6be07693cc
commit 6c49b63e8e
+8 -7
View File
@@ -80,6 +80,7 @@ pipeline {
}
Write-Host "DEBUG: End of found zip listing."
Write-Host "DEBUG: Existing zip files found count: $($existingZips.Count)"
$zipFilename = ""
$zipFound = $false
@@ -89,10 +90,10 @@ pipeline {
$newestZip = $existingZips | Select-Object -First 1
$zipFilename = $newestZip.Name
$zipFound = $true
Write-Host "Found existing zip file: '$zipFilename'. Skipping creation."
Write-Host "DEBUG: Using newest existing zip file: '$zipFilename'. Skipping creation process."
} else {
# No existing zip files, proceed with creation
Write-Host "No existing zip files found. Proceeding with creation."
Write-Host "DEBUG: No existing zip files found. Proceeding with file finding and zipping process."
Write-Host "Searching for files matching $exePattern and $binPattern in the current directory for zipping..."
@@ -158,8 +159,8 @@ pipeline {
}
# Write the determined zip filename to a temporary file
Write-Host "Writing zip filename '$zipFilename' to temporary file '$tempFilenameFile'..."
$zipFilename | Out-File -FilePath $tempFilenameFile -Encoding UTF8 -Force # Corrected: Using -FilePath
Write-Host "Writing determined zip filename '$zipFilename' to temporary file '$tempFilenameFile'..."
$zipFilename | Out-File -FilePath $tempFilenameFile -Encoding UTF8 -Force
exit 0
''' // End powershell script
@@ -176,10 +177,10 @@ pipeline {
// This might happen if the PowerShell script failed before writing the file
echo "Warning: Temporary filename file '${tempFilenameFile}' not found. Zip creation might have failed."
} finally {
// Clean up the temporary file
// Clean up the temporary file using a powershell step
try {
echo "Cleaning up temporary filename file: ${tempFilenameFile} using fileOperations"
fileOperations([genSandboxConfig: true, operations: [[excludes: null, includes: tempFilenameFile, pattern: null, type: 'DELETE']]])
echo "Cleaning up temporary filename file: ${tempFilenameFile} using powershell"
powershell "Remove-Item -Path '${tempFilenameFile}' -Force"
echo "Temporary filename file cleaned up."
} catch (Exception e) {
echo "Warning: Failed to clean up temporary filename file '${tempFilenameFile}': ${e.getMessage()}"