From 53ecfb3cad85fec4d496d1ff4875d0c5c9b5f797 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Sun, 4 May 2025 13:55:15 +0300 Subject: [PATCH] zip update --- build/jenkins/zip | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build/jenkins/zip b/build/jenkins/zip index 1799eb2..32c7543 100644 --- a/build/jenkins/zip +++ b/build/jenkins/zip @@ -1,3 +1,5 @@ +&1)"> +```groovy // This pipeline job is triggered by the main AzaionSuite build pipeline. // It operates directly within the main build job's artifact directory, // zips the artifacts using PowerShell and 7-Zip, and then triggers the Google Drive upload pipeline. @@ -54,7 +56,7 @@ pipeline { // 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, redirecting stderr to stdout + // Capture the output of the powershell script def zipFilenameOutput = powershell returnStdout: true, script: ''' $ErrorActionPreference = "Stop" # Stop the script on any error @@ -163,20 +165,22 @@ pipeline { } # Output the zip filename to standard output for the Groovy script to capture + # Ensure this is the very last thing written to the standard output stream Write-Output $zipFilename exit 0 - ''' 2>&1 // End powershell script and redirect stderr to stdout + ''' // End powershell script // Capture the output and set the environment variable // The PowerShell script outputs the zip filename as the last line // Use readLines() to handle multi-line output and get the last line - def outputLines = zipFilenameOutput.readLines() + def outputLines = zipFilenameOutput.readLines().findAll { it.trim() != '' } // Filter out empty lines if (!outputLines.isEmpty()) { env.CREATED_ZIP_FILENAME = outputLines.last().trim() echo "Set CREATED_ZIP_FILENAME environment variable to: ${env.CREATED_ZIP_FILENAME}" } else { - error "PowerShell script did not produce any output to capture the zip filename." + // This error should now be more informative if no output is captured + error "PowerShell script did not produce any non-empty output lines to capture the zip filename." } @@ -228,3 +232,4 @@ pipeline { } // End stage block } // End of stages block } // End of pipeline block +``` \ No newline at end of file