zip update

This commit is contained in:
dzaitsev
2025-05-04 13:50:56 +03:00
parent f100ed638d
commit ea71ec2add
+22 -3
View File
@@ -53,7 +53,7 @@ pipeline {
// def defaultVersion = '1.0.0'
// Use a powershell step to perform file finding, filename extraction, timestamp generation, and zipping
// Use a powershell step to check for existing zip, or create a new one, then output the filename
// Capture the output of the powershell script
def zipFilenameOutput = powershell returnStdout: true, script: '''
$ErrorActionPreference = "Stop" # Stop the script on any error
@@ -62,6 +62,26 @@ pipeline {
$defaultVersion = "1.0.0" # Default version if no exe is found
$exePattern = "AzaionSuite*.exe"
$binPattern = "AzaionSuite*.bin"
$zipPattern = "AzaionSuite*.zip" # Pattern for existing zip files
Write-Host "Operating in directory: $(Get-Location)"
# --- Check for existing zip files ---
Write-Host "Checking for existing zip files matching '$zipPattern'..."
$existingZips = Get-ChildItem -Path . -Include $zipPattern | Sort-Object LastWriteTime -Descending
$zipFilename = ""
$zipFound = $false
if ($existingZips.Count -gt 0) {
# Found existing zip files, use the newest one
$newestZip = $existingZips | Select-Object -First 1
$zipFilename = $newestZip.Name
$zipFound = $true
Write-Host "Found existing zip file: '$zipFilename'. Skipping creation."
} else {
# No existing zip files, proceed with creation
Write-Host "No existing zip files found. Proceeding with creation."
Write-Host "Searching for files matching $exePattern and $binPattern in the current directory for zipping..."
@@ -124,10 +144,9 @@ pipeline {
}
Write-Host "Zip archive created successfully by 7-Zip: $zipFilename"
}
# Output the zip filename to standard output for the Groovy script to capture
# Write-Host "::SET-ZIP-FILENAME::$zipFilename" # Removed, using Write-Output instead
# Write-Host "::SET-ENV::CREATED_ZIP_FILENAME=$zipFilename" # Removed, using Write-Output instead
Write-Output $zipFilename
exit 0