From c999acd12074310a0c5a4f796ec2f3e6f5aaa684 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Sun, 4 May 2025 13:27:45 +0300 Subject: [PATCH] gdrive update zip update --- build/jenkins/zip | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/build/jenkins/zip b/build/jenkins/zip index 2a6bd8c..78a7676 100644 --- a/build/jenkins/zip +++ b/build/jenkins/zip @@ -48,7 +48,7 @@ pipeline { // Define the expected artifact patterns relative to the current directory (MAIN_BUILD_ARTIFACTS_DIR) def exePattern = 'AzaionSuite*.exe' def binPattern = 'AzaionSuite*.bin' - // Define defaultVersion here, as it's used within the bat script + // Define defaultVersion here, as it's used within the bat script if no exe is found def defaultVersion = '1.0.0' @@ -85,31 +85,22 @@ pipeline { echo Found !file_count! file(s) to archive. - rem --- Version Extraction (only from .exe if present) --- - set "VERSION=%DEFAULT_VERSION%" + rem --- Determine Base Filename for Zip --- + set "ZIP_BASE_FILENAME=" if defined EXE_FILE ( - echo Attempting to extract version from "%EXE_FILE%"... - rem Extract filename from full path - for %%I in ("%EXE_FILE%") do set "EXE_FILENAME=%%~nxI" - rem Extract part after AzaionSuite and before .exe - rem Assumes format AzaionSuite.exe - set "TEMP_VERSION=!EXE_FILENAME:AzaionSuite=!" - set "VERSION=!TEMP_VERSION:.exe=!" - rem Basic check if extraction was successful - if "!VERSION!" == "!TEMP_VERSION!" ( - echo Warning: Could not extract version from "%EXE_FILENAME%". Using default: %VERSION% - set "VERSION=%DEFAULT_VERSION%" - ) else ( - echo Found version for archive: %VERSION% - ) + echo Using executable filename as base for archive name: "%EXE_FILE%"... + rem Extract filename without extension from full path + for %%I in ("%EXE_FILE%") do set "ZIP_BASE_FILENAME=%%~nI" + echo Extracted base filename: !ZIP_BASE_FILENAME! ) else ( - echo Warning: No executable found to extract version for archive. Using default: %VERSION% + echo Warning: No executable found. Using default base filename: AzaionSuite.!DEFAULT_VERSION! + set "ZIP_BASE_FILENAME=AzaionSuite.!DEFAULT_VERSION!" ) rem --- Zipping Logic --- - rem Get current date and time inMMDD-HHmmss format using wmic + rem Get current date and time in YYYYMMDD-HHmmss format using wmic rem wmic output format is LocalDateTime=YYYYMMDDHHMMSS.milliseconds+UTCoffset for /f "tokens=2 delims==" %%a in ('wmic os get localdatetime /value') do set "dt=%%a" set "YYYY=%dt:~0,4%" @@ -120,7 +111,8 @@ pipeline { set "SS=%dt:~12,2%" set "timestamp=%YYYY%%MM%%DD%-%HH%%mm%%SS%" - set "ZIP_FILENAME=AzaionSuite.%VERSION%-%timestamp%.zip" + rem Construct the final zip filename using the base filename and timestamp + set "ZIP_FILENAME=!ZIP_BASE_FILENAME!.%timestamp%.zip" echo Creating zip archive: %ZIP_FILENAME% using 7-Zip.