From d202e8ec05a74879b77887d4f59ab9583af21127 Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Mon, 2 Sep 2024 13:03:30 +0100 Subject: [PATCH] Init & sync the mirror --- src/new_build.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/new_build.sh b/src/new_build.sh index 15b3e37..e2d3a00 100644 --- a/src/new_build.sh +++ b/src/new_build.sh @@ -26,7 +26,7 @@ # - PARALLEL_JOBS # - RETRY_FETCHES # - handle local manifests -# - Sync mirror +# - Sync mirror if we're using one # - Branch-specific stuff # - main sync and build loop For each device in `$DEVICE_LIST` # - setup build overlay @@ -133,3 +133,23 @@ if [ "$INCLUDE_PROPRIETARY" = true ]; then /root/build_manifest.py --remote "https://gitlab.com" --remotename "gitlab_https" \ "https://gitlab.com/the-muppets/manifest/raw/$themuppets_branch/muppets.xml" .repo/local_manifests/proprietary_gitlab.xml fi + +# Sync mirror if we're using one +if [ "$LOCAL_MIRROR" = true ]; then + + cd "$MIRROR_DIR" + if [ "$INIT_MIRROR" = true ]; then + if [ ! -d .repo ]; then + echo ">> [$(date)] Initializing mirror repository" | tee -a "$repo_log" + ( yes||: ) | repo init -u https://github.com/LineageOS/mirror --mirror --no-clone-bundle -p linux --git-lfs &>> "$repo_log" + fi + else + echo ">> [$(date)] Initializing mirror repository disabled" | tee -a "$repo_log" + fi + if [ "$SYNC_MIRROR" = true ]; then + echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" + repo sync "${jobs_arg[@]}" --force-sync --no-clone-bundle &>> "$repo_log" + else + echo ">> [$(date)] Sync mirror repository disabled" | tee -a "$repo_log" + fi +fi