From ff6e548bd9e6622f59625d62516abc71ff9b22cb Mon Sep 17 00:00:00 2001 From: Simon Southwell Date: Sat, 12 Sep 2020 08:32:49 +0100 Subject: [PATCH] Added batch scripts for adding, pulling and pushing an EL-GENERIC-IP subtree in project repositories --- utilities/elgip_add.bat | 37 +++++++++++++++++++++++++++++++++++++ utilities/elgip_pull.bat | 36 ++++++++++++++++++++++++++++++++++++ utilities/elgip_push.bat | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 utilities/elgip_add.bat create mode 100644 utilities/elgip_pull.bat create mode 100644 utilities/elgip_push.bat diff --git a/utilities/elgip_add.bat b/utilities/elgip_add.bat new file mode 100644 index 0000000..70847d0 --- /dev/null +++ b/utilities/elgip_add.bat @@ -0,0 +1,37 @@ +@echo off +REM ============================================================= +REM +REM Copyright (c) 2020 Simon Southwell. All rights reserved. +REM +REM Date: 12th Sep 2020 +REM +REM Script to add EL-GENERIC-IP as a subtree to a project +REM repository. +REM +REM See https://confluence.gisapps.co.uk/display/EL/EL+Subtrees +REM for more details +REM +REM ============================================================= + +REM check if in the correct directory (i.e. firmware exists) +if not exist firmware ( + @echo No firmware directory found. Check you are in your repository's top level folder. Exiting + @exit /b +) + +REM check if there is still a link to generic_ip +if exist firmware\generic_ip ( + echo Found firmware\generic_ip. Please delete the folder or link before proceeding. Exiting + exit /b +) + +REM check if there isn't a subtree already +if exist firmware\el_generic_ip ( + echo Found firmware\el_generic_ip. Subtree already exists. If not, please remove folder before proceeding. Exiting + exit /b +) + +echo Adding EL-GENERIC-IP subtree to firmware\el_generic_ip + +git remote add EL-GENERIC-IP git@hydra:GIS_Embedded_Logic/EL-GENERIC-IP.git +git subtree add --prefix=firmware/el_generic_ip EL-GENERIC-IP master \ No newline at end of file diff --git a/utilities/elgip_pull.bat b/utilities/elgip_pull.bat new file mode 100644 index 0000000..7a92a26 --- /dev/null +++ b/utilities/elgip_pull.bat @@ -0,0 +1,36 @@ +@echo off +REM ============================================================= +REM +REM Copyright (c) 2020 Simon Southwell. All rights reserved. +REM +REM Date: 12th Sep 2020 +REM +REM Script to pull latest EL-GENERIC-IP files into local +REM subtree of repository. +REM +REM See https://confluence.gisapps.co.uk/display/EL/EL+Subtrees +REM for more details +REM +REM ============================================================= + +REM check if in the correct directory (i.e. firmware exists) +if not exist firmware ( + @echo No firmware directory found. Check you are in your repository's top level folder. Exiting + @exit /b +) + +REM check if there is still a link to generic_ip +if exist firmware\generic_ip ( + echo Found firmware\generic_ip. Please check that the subtree has been added and remove the link before proceeding. Exiting + exit /b +) + +REM check if there is a subtree folder +if not exist firmware\el_generic_ip ( + echo Didn't find firmware\el_generic_ip. Subtree doesn't exist. Please run elgip_add.bat to add the subtree. Exiting + exit /b +) + +echo Pulling latest subtree files from repository + +git subtree pull --prefix=firmware/el_generic_ip EL-GENERIC-IP master \ No newline at end of file diff --git a/utilities/elgip_push.bat b/utilities/elgip_push.bat new file mode 100644 index 0000000..18649e3 --- /dev/null +++ b/utilities/elgip_push.bat @@ -0,0 +1,36 @@ +@echo off +REM ============================================================= +REM +REM Copyright (c) 2020 Simon Southwell. All rights reserved. +REM +REM Date: 12th Sep 2020 +REM +REM Script to push latest subtree modified files to +REM EL-GENERIC-IP repository. +REM +REM See https://confluence.gisapps.co.uk/display/EL/EL+Subtrees +REM for more details +REM +REM ============================================================= + +REM check if in the correct directory (i.e. firmware exists) +if not exist firmware ( + @echo No firmware directory found. Check you are in your repository's top level folder. Exiting + @exit /b +) + +REM check if there is still a link to generic_ip +if exist firmware\generic_ip ( + echo Found firmware\generic_ip. Please check that the subtree has been added and remove the link before proceeding. Exiting + exit /b +) + +REM check if there is a subtree folder +if not exist firmware\el_generic_ip ( + echo Didn't find firmware\el_generic_ip. Subtree doesn't exist. Please run elgip_add.bat to add the subtree. Exiting + exit /b +) + +echo Pushing modified subtree files to repository + +git subtree push --prefix=firmware/el_generic_ip EL-GENERIC-IP master \ No newline at end of file