From 84a32f32885c8a2690d3babf279e63bb97a2224f Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Mon, 23 Jul 2018 17:03:05 +0800 Subject: [PATCH] ci: Use local mirrors on the public branches (master, release-) too Use DONT_USE_MIRROR=1 to force using the original repositories if you need --- tools/ci/get-full-sources.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci/get-full-sources.sh b/tools/ci/get-full-sources.sh index ee2604a31a..a332b18e28 100755 --- a/tools/ci/get-full-sources.sh +++ b/tools/ci/get-full-sources.sh @@ -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 }