Commit e05b83300d026fb11b437cfa6845a8fb8fd1bf1b

Authored by Steven de Ridder
1 parent f027e1db

Adjusted script to check closed_source if repo does not exist in open_source

Showing 1 changed file with 14 additions and 2 deletions
scripts/setup_submodules
@@ -4,6 +4,10 @@ @@ -4,6 +4,10 @@
4 # == Setting some environment variables 4 # == Setting some environment variables
5 # =============================================== 5 # ===============================================
6 GIT_URL_SUBS="http://gitlab.osdev.nl/open_source" 6 GIT_URL_SUBS="http://gitlab.osdev.nl/open_source"
  7 +GIT_URL_SUBS_CLOSED="http://gitlab.osdev.nl/closed_source"
  8 +
  9 +OPEN_REPOS=("mqtt-cpp" "transqueue" "orm" "network" "jobscheduler" "global" "dbconnector" "logutils" "pugixml" "qt-mqtt" "iputils" "crypter" "qt-bluetooth" "versioning" "cmake")
  10 +
7 FUNC_RESULT="-1" 11 FUNC_RESULT="-1"
8 12
9 # Name : print_usage_exit() 13 # Name : print_usage_exit()
@@ -101,8 +105,16 @@ function add_submodules() @@ -101,8 +105,16 @@ function add_submodules()
101 for SUB_MODULE in ${SUB_MODULES} 105 for SUB_MODULE in ${SUB_MODULES}
102 do 106 do
103 echo -e "< ${SUB_MODULE} >" 107 echo -e "< ${SUB_MODULE} >"
104 - git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE}  
105 - git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git 108 + if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]];
  109 + then
  110 + echo "open_source repo"
  111 + git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE}
  112 + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git
  113 + else
  114 + echo "closed_source repo"
  115 + git submodule add -f ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git ${SUB_MODULE}
  116 + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git
  117 + fi
106 done 118 done
107 } 119 }
108 120