From bf731485b661717288107f8663b6dc7706de6aba Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 7 Jun 2019 19:50:46 -0400 Subject: [PATCH] reducing scripts duplication --- .../nucleo_f746/!compile-nucleo_f746.bat | 3 ++ .../nucleo_f767/!compile-nucleo_f767.bat | 3 ++ .../compile_other_versions/build_version.bat | 6 ++-- .../compile_and_upload.bat | 30 +++++++++++++++++++ misc/jenkins/compile_other_versions/run.bat | 15 +++------- 5 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 misc/jenkins/compile_other_versions/compile_and_upload.bat diff --git a/firmware/config/boards/nucleo_f746/!compile-nucleo_f746.bat b/firmware/config/boards/nucleo_f746/!compile-nucleo_f746.bat index 56ac139a6a..593ffbce32 100644 --- a/firmware/config/boards/nucleo_f746/!compile-nucleo_f746.bat +++ b/firmware/config/boards/nucleo_f746/!compile-nucleo_f746.bat @@ -2,6 +2,9 @@ rem rem STM32F767 version of the firmware for Nucleo-F746ZG board rem +bundle_nameset script_name=!compile-nucleo_f746.bat +echo Entering %script_name% + cd ../../.. set PROJECT_BOARD=nucleo_F746 set PROJECT_CPU=ARCH_STM32F7 diff --git a/firmware/config/boards/nucleo_f767/!compile-nucleo_f767.bat b/firmware/config/boards/nucleo_f767/!compile-nucleo_f767.bat index f83e36cde9..bbfb893d49 100644 --- a/firmware/config/boards/nucleo_f767/!compile-nucleo_f767.bat +++ b/firmware/config/boards/nucleo_f767/!compile-nucleo_f767.bat @@ -2,6 +2,9 @@ rem rem STM32F767 version of the firmware for Nucleo-F767ZI board rem +bundle_nameset script_name=!compile-nucleo_f767.bat +echo Entering %script_name% + cd ../../.. set PROJECT_BOARD=nucleo_f767 set PROJECT_CPU=ARCH_STM32F7 diff --git a/misc/jenkins/compile_other_versions/build_version.bat b/misc/jenkins/compile_other_versions/build_version.bat index bab2e5988f..d1b58c1852 100644 --- a/misc/jenkins/compile_other_versions/build_version.bat +++ b/misc/jenkins/compile_other_versions/build_version.bat @@ -1,5 +1,5 @@ -set script_name=build_version.bat -echo Entering %script_name% +bundle_nameset script_name=build_version.bat +echo Entering %script_name% with %bundle_name% rm -rf temp @@ -9,7 +9,7 @@ set folder=temp\%folder% rem this replaces spaces with 0s - that's needed before 10am set folder=%folder: =0% -echo Building file +echo Packaging temp\rusefi_bundle.zip file call misc\jenkins\build_working_folder.bat rem TODO: extract FTP duplication with 407 build diff --git a/misc/jenkins/compile_other_versions/compile_and_upload.bat b/misc/jenkins/compile_other_versions/compile_and_upload.bat new file mode 100644 index 0000000000..995b993210 --- /dev/null +++ b/misc/jenkins/compile_other_versions/compile_and_upload.bat @@ -0,0 +1,30 @@ +set COMPILE_FOLDER=%1 +set COMPILE_SCRIPT=%2 + +bundle_nameset script_name=combile_and_upload.bat +echo Entering %script_name% with %COMPILE_FOLDER% %COMPILE_SCRIPT% + + +if %COMPILE_FOLDER%.==. ( + echo COMPILE_FOLDER parameter expected + exit -1 +) + +if %COMPILE_SCRIPT%.==. ( + echo COMPILE_SCRIPT parameter expected + exit -1 +) + + +cd firmware +call clean.bat +cd .. + + +cd firmware\config +cd %COMPILE_FOLDER% + +call %COMPILE_SCRIPT% + +pwd +echo "exiting %script_name%" diff --git a/misc/jenkins/compile_other_versions/run.bat b/misc/jenkins/compile_other_versions/run.bat index 1fe1b52bf6..95067bd98c 100644 --- a/misc/jenkins/compile_other_versions/run.bat +++ b/misc/jenkins/compile_other_versions/run.bat @@ -9,13 +9,9 @@ call misc\jenkins\build_java_console.bat if not exist java_console_binary/rusefi_console.jar exit -1 - -cd firmware -call clean.bat -cd .. +call misc\jenkins\compile_other_versions\compile_and_upload.bat nucleo_f746 !compile-nucleo_f746.bat +pwd echo %script_name%: Compiling F746 -cd firmware\config\boards\nucleo_f746 -call !compile-nucleo_f746.bat if not exist build/rusefi.hex echo Just to confirm - FAILED to compile nucleo_f746 if not exist build/rusefi.hex exit -1 cd .. @@ -25,12 +21,9 @@ call misc\jenkins\compile_other_versions\build_version.bat echo %script_name%: Done with F746-nucleo -cd firmware -call clean.bat -cd .. +call misc\jenkins\compile_other_versions\compile_and_upload.bat nucleo_f767 !compile-nucleo_f767.bat +pwd echo %script_name%: Compiling F767 -cd firmware\config\boards\nucleo_f767 -call !compile-nucleo_f767.bat if not exist build/rusefi.hex echo Just to confirm - FAILED to compile nucleo_f767 if not exist build/rusefi.hex exit -1 cd ..