mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
ci: Use a local mirror for getting submodules
This commit is contained in:
@@ -77,6 +77,7 @@ before_script:
|
|||||||
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||||
|
- if [ "${LOCAL_GITLAB_SSH_SERVER:-}" ]; then SRV=${LOCAL_GITLAB_SSH_SERVER##*@};SRV=${SRV%%:*};printf "Host %s\n\tStrictHostKeyChecking no\n" "${SRV}" >> ~/.ssh/config; fi
|
||||||
# Download and install tools, if needed
|
# Download and install tools, if needed
|
||||||
- *setup_tools_unless_target_test
|
- *setup_tools_unless_target_test
|
||||||
|
|
||||||
@@ -119,6 +120,7 @@ before_script:
|
|||||||
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||||
|
- if [ "${LOCAL_GITLAB_SSH_SERVER:-}" ]; then SRV=${LOCAL_GITLAB_SSH_SERVER##*@};SRV=${SRV%%:*};printf "Host %s\n\tStrictHostKeyChecking no\n" "${SRV}" >> ~/.ssh/config; fi
|
||||||
|
|
||||||
build_template_app:
|
build_template_app:
|
||||||
stage: build
|
stage: build
|
||||||
|
@@ -29,6 +29,12 @@ die() {
|
|||||||
[ -z ${CI_PROJECT_DIR} ] && die "This internal script should only be run by a Gitlab CI runner."
|
[ -z ${CI_PROJECT_DIR} ] && die "This internal script should only be run by a Gitlab CI runner."
|
||||||
[ -z ${GITLAB_SSH_SERVER} ] && die "GITLAB_SSH_SERVER should be defined to run mirror-submodule-update.sh"
|
[ -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_REPOSITORY_URL} ] && die "CI_REPOSITORY_URL should be defined to run mirror-submodule-update.sh"
|
||||||
|
|
||||||
|
REPOSITORY_URL="${CI_REPOSITORY_URL}"
|
||||||
|
if [ "${LOCAL_GITLAB_SSH_SERVER:-}" ]; then
|
||||||
|
REPOSITORY_URL="https://gitlab-ci-token:${CI_JOB_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
[ -z ${CI_COMMIT_SHA} ] && die "CI_COMMIT_SHA 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"
|
||||||
DONT_USE_MIRROR=${DONT_USE_MIRROR:-"0"}
|
DONT_USE_MIRROR=${DONT_USE_MIRROR:-"0"}
|
||||||
|
|
||||||
@@ -81,7 +87,7 @@ for try in `seq $RETRIES`; do
|
|||||||
cd ${CI_PROJECT_DIR} # we are probably already here but pays to be certain
|
cd ${CI_PROJECT_DIR} # we are probably already here but pays to be certain
|
||||||
echo "Trying a clean clone of IDF..."
|
echo "Trying a clean clone of IDF..."
|
||||||
del_files
|
del_files
|
||||||
git clone ${CI_REPOSITORY_URL} . &&
|
git clone ${REPOSITORY_URL} . &&
|
||||||
git checkout ${CI_COMMIT_SHA} &&
|
git checkout ${CI_COMMIT_SHA} &&
|
||||||
update_submodules &&
|
update_submodules &&
|
||||||
echo "Clone strategy succeeded" &&
|
echo "Clone strategy succeeded" &&
|
||||||
|
@@ -26,6 +26,10 @@ die() {
|
|||||||
|
|
||||||
[ -z ${GITLAB_SSH_SERVER:-} ] && die "Have to set up GITLAB_SSH_SERVER environment variable"
|
[ -z ${GITLAB_SSH_SERVER:-} ] && die "Have to set up GITLAB_SSH_SERVER environment variable"
|
||||||
|
|
||||||
|
if [ "${LOCAL_GITLAB_SSH_SERVER:-}" ]; then
|
||||||
|
GITLAB_SSH_SERVER="${LOCAL_GITLAB_SSH_SERVER}"
|
||||||
|
fi
|
||||||
|
|
||||||
ERR_CANNOT_UPDATE=13
|
ERR_CANNOT_UPDATE=13
|
||||||
|
|
||||||
REPO_DIR=${1:-"${PWD}"}
|
REPO_DIR=${1:-"${PWD}"}
|
||||||
|
Reference in New Issue
Block a user