From e3d8686e2baaa59c7502fa309b100ee666bb91ff Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 8 Jun 2019 10:57:41 -0400 Subject: [PATCH] reducing scripts duplication --- .../compile_and_upload.bat | 13 +++-- misc/jenkins/compile_other_versions/run.bat | 47 ++++--------------- 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/misc/jenkins/compile_other_versions/compile_and_upload.bat b/misc/jenkins/compile_other_versions/compile_and_upload.bat index a90f1d2e53..ff45a6f135 100644 --- a/misc/jenkins/compile_other_versions/compile_and_upload.bat +++ b/misc/jenkins/compile_other_versions/compile_and_upload.bat @@ -1,21 +1,21 @@ set COMPILE_FOLDER=%1 -set BOARD_NAME=%2 +set bundle_name=%2 set script_name=combile_and_upload.bat -echo Entering %script_name% with %COMPILE_FOLDER% %BOARD_NAME% +echo Entering %script_name% with %COMPILE_FOLDER% %bundle_name% if %COMPILE_FOLDER%.==. ( echo COMPILE_FOLDER parameter expected exit -1 ) -if %BOARD_NAME%.==. ( - echo BOARD_NAME parameter expected +if %bundle_name%.==. ( + echo bundle_name parameter expected exit -1 ) -set COMPILE_SCRIPT=!compile-%BOARD_NAME%.bat +set COMPILE_SCRIPT=!compile-%bundle_name%.bat cd firmware call clean.bat @@ -34,4 +34,7 @@ if not exist build/rusefi.hex exit -1 cd .. rem We are back at root rusEfi folder pwd + +call misc\jenkins\compile_other_versions\build_version.bat + echo "exiting %script_name%" diff --git a/misc/jenkins/compile_other_versions/run.bat b/misc/jenkins/compile_other_versions/run.bat index f8b1897f1a..711d899c75 100644 --- a/misc/jenkins/compile_other_versions/run.bat +++ b/misc/jenkins/compile_other_versions/run.bat @@ -8,64 +8,33 @@ pwd call misc\jenkins\build_java_console.bat if not exist java_console_binary/rusefi_console.jar exit -1 - -set bundle_name=stm32f746_nucleo call misc\jenkins\compile_other_versions\compile_and_upload.bat nucleo_f746 stm32f746_nucleo IF NOT ERRORLEVEL 0 echo ERROR invoking compile_and_upload.bat IF NOT ERRORLEVEL 0 EXIT /B 1 pwd -call misc\jenkins\compile_other_versions\build_version.bat -echo %script_name%: Done with F746-nucleo -set bundle_name=stm32f767_nucleo call misc\jenkins\compile_other_versions\compile_and_upload.bat nucleo_f767 stm32f767_nucleo IF NOT ERRORLEVEL 0 echo ERROR invoking compile_and_upload.bat IF NOT ERRORLEVEL 0 EXIT /B 1 pwd -call misc\jenkins\compile_other_versions\build_version.bat -echo %script_name%: Done with F767-nucleo -set bundle_name=stm32f767_osc call misc\jenkins\compile_other_versions\compile_and_upload.bat nucleo_f767 stm32f767_osc IF NOT ERRORLEVEL 0 echo ERROR invoking compile_and_upload.bat IF NOT ERRORLEVEL 0 EXIT /B 1 pwd + + +call misc\jenkins\compile_other_versions\compile_and_upload.bat prometheus prometheus_405 +IF NOT ERRORLEVEL 0 echo ERROR invoking compile_and_upload.bat +IF NOT ERRORLEVEL 0 EXIT /B 1 pwd -call misc\jenkins\compile_other_versions\build_version.bat -echo %script_name%: Done with F767-osc - -cd firmware -call clean.bat -cd .. -echo %script_name%: Compiling prometheus_405 -cd firmware\config\boards\prometheus -call !compile-prometheus-405.bat -if not exist build/rusefi.hex echo Just to confirm - FAILED to compile prometheus-405 -if not exist build/rusefi.hex exit -1 -cd .. +call misc\jenkins\compile_other_versions\compile_and_upload.bat prometheus prometheus_469 +IF NOT ERRORLEVEL 0 echo ERROR invoking compile_and_upload.bat +IF NOT ERRORLEVEL 0 EXIT /B 1 pwd -set bundle_name=prometheus_405 -call misc\jenkins\compile_other_versions\build_version.bat -echo %script_name%: Done with prometheus_405 - - - -cd firmware -call clean.bat -cd .. -echo %script_name%: Compiling prometheus_469 -cd firmware\config\boards\prometheus -call !compile-prometheus-469.bat -if not exist build/rusefi.hex echo Just to confirm - FAILED to compile prometheus-469 -if not exist build/rusefi.hex exit -1 -cd .. -pwd -set bundle_name=prometheus_469 -call misc\jenkins\compile_other_versions\build_version.bat -echo %script_name%: Done with prometheus_469