ci: Use local mirrors on the public branches (master, release-) too
authorAnton Maklakov <anton@espressif.com>
Mon, 23 Jul 2018 09:03:05 +0000 (17:03 +0800)
committerHe Yin Ling <heyinling@espressif.com>
Tue, 28 Aug 2018 15:43:30 +0000 (23:43 +0800)
    Use DONT_USE_MIRROR=1 to force using the original repositories if you need

tools/ci/get-full-sources.sh

index ee2604a31abad3010900e8b1362dacba4b1615e8..a332b18e28eaea631f089c13242bb188da4417ea 100755 (executable)
@@ -30,16 +30,16 @@ die() {
 [ -z ${GITLAB_SSH_SERVER} ] && die "GITLAB_SSH_SERVER should be defined to run mirror-submodule-update.sh"
 [ -z ${CI_REPOSITORY_URL} ] && die "CI_REPOSITORY_URL should be defined to run mirror-submodule-update.sh"
 [ -z ${CI_COMMIT_SHA} ] && die "CI_COMMIT_SHA should be defined to run mirror-submodule-update.sh"
-[[ ( -z ${IS_PRIVATE} ) && ( -z ${IS_PUBLIC} ) ]] && die "IS_PRIVATE or IS_PUBLIC should be defined in the CI environment."
+DONT_USE_MIRROR=${DONT_USE_MIRROR:-"0"}
 
 ERR_CANNOT_UPDATE=13
 
 SCRIPT_DIR=$(dirname -- "${0}")
 update_submodules() {
-    if [ "${IS_PRIVATE}" ]; then
-        ${SCRIPT_DIR}/mirror-submodule-update.sh || return $?
-    else
+    if [ "${DONT_USE_MIRROR}" = "1" ]; then
         git submodule update --init --recursive
+    else
+        ${SCRIPT_DIR}/mirror-submodule-update.sh || return $?
     fi
 }