From b8b4a33f9f91c547bd5b63f1a25d57a9236ccae5 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 15:12:52 +0300 Subject: [PATCH 1/6] init.cmd - fix for Jenkins incorrect handle of pushd/popd --- build/init.cmd | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/init.cmd b/build/init.cmd index fafef12..9e6c981 100644 --- a/build/init.cmd +++ b/build/init.cmd @@ -1,12 +1,18 @@ echo Make dirs, copy init dlls -pushd %~dp0.. +:: Change to the directory where init.cmd is located +cd /d %~dp0.. + +:: Create directories if they do not exist if exist dist-dlls rmdir dist-dlls /s /q mkdir dist-dlls if exist dist-azaion rmdir dist-azaion /s /q mkdir dist-azaion echo Copying shared libs + +:: Use robocopy to copy files robocopy "C:\\share" "dist-dlls" "*" -popd \ No newline at end of file +:: Return to the previous directory +cd /d %OLDPWD% From 41b96e2ce5ea59ce5b89a17d55553001c2d02bc7 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 15:58:48 +0300 Subject: [PATCH 2/6] Revert "init.cmd - fix for Jenkins incorrect handle of pushd/popd" This reverts commit b8b4a33f9f91c547bd5b63f1a25d57a9236ccae5. --- build/init.cmd | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/build/init.cmd b/build/init.cmd index 9e6c981..fafef12 100644 --- a/build/init.cmd +++ b/build/init.cmd @@ -1,18 +1,12 @@ echo Make dirs, copy init dlls +pushd %~dp0.. -:: Change to the directory where init.cmd is located -cd /d %~dp0.. - -:: Create directories if they do not exist if exist dist-dlls rmdir dist-dlls /s /q mkdir dist-dlls if exist dist-azaion rmdir dist-azaion /s /q mkdir dist-azaion echo Copying shared libs - -:: Use robocopy to copy files robocopy "C:\\share" "dist-dlls" "*" -:: Return to the previous directory -cd /d %OLDPWD% +popd \ No newline at end of file From 8d9fe62c53ada9aed9bf62cadecc9ca93a21d5f7 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 16:12:06 +0300 Subject: [PATCH 3/6] changed robocopy return code --- build/init.cmd | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build/init.cmd b/build/init.cmd index fafef12..a7d1769 100644 --- a/build/init.cmd +++ b/build/init.cmd @@ -8,5 +8,18 @@ mkdir dist-azaion echo Copying shared libs robocopy "C:\\share" "dist-dlls" "*" +set RC=%ERRORLEVEL% -popd \ No newline at end of file +if %RC% EQU 1 ( + echo All files copied successfully. + popd + exit /b 1 +) else if %RC% LSS 8 ( + echo Robocopy returned %RC% (acceptable non-error code), but not perfect copy. + popd + exit /b 0 +) else ( + echo Robocopy failed with code %RC%. + popd + exit /b %RC% +) \ No newline at end of file From 52c724eac60cebe64b633bb741ab12e4b5a59c36 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 16:15:02 +0300 Subject: [PATCH 4/6] changed robocopy return code --- build/init.cmd | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/build/init.cmd b/build/init.cmd index a7d1769..11e98a4 100644 --- a/build/init.cmd +++ b/build/init.cmd @@ -10,16 +10,12 @@ echo Copying shared libs robocopy "C:\\share" "dist-dlls" "*" set RC=%ERRORLEVEL% -if %RC% EQU 1 ( - echo All files copied successfully. - popd - exit /b 1 -) else if %RC% LSS 8 ( - echo Robocopy returned %RC% (acceptable non-error code), but not perfect copy. - popd - exit /b 0 -) else ( +if %RC% GEQ 8 ( echo Robocopy failed with code %RC%. popd exit /b %RC% -) \ No newline at end of file +) + +echo Robocopy succeeded with code %RC%. +popd +exit /b 0 \ No newline at end of file From 22f047bbe529e3eb2278a5d29758dc55ad377706 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 16:18:38 +0300 Subject: [PATCH 5/6] changed robocopy return code --- build/init.cmd | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/build/init.cmd b/build/init.cmd index 11e98a4..56e0250 100644 --- a/build/init.cmd +++ b/build/init.cmd @@ -1,21 +1,22 @@ echo Make dirs, copy init dlls -pushd %~dp0.. +REM Save the current directory +set CURRENT_DIR=%cd% +REM Change to the parent directory of the current location +cd /d %~dp0.. + +REM Remove and recreate the dist-dlls and dist-azaion directories if exist dist-dlls rmdir dist-dlls /s /q mkdir dist-dlls if exist dist-azaion rmdir dist-azaion /s /q mkdir dist-azaion echo Copying shared libs + +REM Copy the shared libs from the source location to dist-dlls robocopy "C:\\share" "dist-dlls" "*" -set RC=%ERRORLEVEL% -if %RC% GEQ 8 ( - echo Robocopy failed with code %RC%. - popd - exit /b %RC% -) +REM Return to the original directory +cd /d %CURRENT_DIR% -echo Robocopy succeeded with code %RC%. -popd -exit /b 0 \ No newline at end of file +echo Init script completed. From 8bf9d1d7e2245e6ff322af73871242ea82d1bac0 Mon Sep 17 00:00:00 2001 From: dzaitsev Date: Wed, 7 May 2025 16:47:26 +0300 Subject: [PATCH 6/6] altered pushd / pulld commands in cmd --- Azaion.Inference/build_inference.cmd | 7 +++++-- build/build_dotnet.cmd | 5 +++-- build/download_models.cmd | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Azaion.Inference/build_inference.cmd b/Azaion.Inference/build_inference.cmd index 2d737f8..f0b14f7 100644 --- a/Azaion.Inference/build_inference.cmd +++ b/Azaion.Inference/build_inference.cmd @@ -1,5 +1,8 @@ echo Build Cython app -pushd %~dp0 +set CURRENT_DIR=%cd% + +REM Change to the parent directory of the current location +cd /d %~dp0.. echo remove dist folder: if exist dist rmdir dist /s /q @@ -60,4 +63,4 @@ robocopy "dist\azaion-inference\_internal" "..\dist-azaion\_internal" "security. robocopy "dist\azaion-inference\_internal" "..\dist-dlls\_internal" /E /MOVE robocopy "dist\azaion-inference" "..\dist-azaion" "azaion-inference.exe" /E /MOVE -popd \ No newline at end of file +cd /d %CURRENT_DIR% diff --git a/build/build_dotnet.cmd b/build/build_dotnet.cmd index efc800f..70b7729 100644 --- a/build/build_dotnet.cmd +++ b/build/build_dotnet.cmd @@ -1,5 +1,6 @@ echo Build .net app -pushd %~dp0.. +set CURRENT_DIR=%cd% +cd /d %~dp0.. dotnet build -c Release @@ -24,4 +25,4 @@ robocopy "dist" "dist-dlls" /E /MOVE echo Copy ico copy logo.ico dist-azaion\ -popd \ No newline at end of file +cd /d %CURRENT_DIR% \ No newline at end of file diff --git a/build/download_models.cmd b/build/download_models.cmd index f43a5dc..d6cc6c9 100644 --- a/build/download_models.cmd +++ b/build/download_models.cmd @@ -1,5 +1,8 @@ echo Download onnx model -pushd %~dp0 +set CURRENT_DIR=%cd% + +REM Change to the parent directory of the current location +cd /d %~dp0.. if not exist cdn_manager.exe ( echo Install cdn_manager @@ -8,4 +11,4 @@ if not exist cdn_manager.exe ( call cdn_manager.exe download models move models ..\dist-dlls\ -popd \ No newline at end of file +cd /d %CURRENT_DIR%