always use GitLab Pages, not Artifacts, with index-only mode

If the repo is too large, then it'll hit the GitLab Pages limit.  That is
basically impossible in index-only mode, so it should always use Pages.
This commit is contained in:
Hans-Christoph Steiner 2024-06-11 20:12:46 +02:00
parent 034e83bfca
commit fbb6772e37
2 changed files with 8 additions and 2 deletions

View File

@ -797,7 +797,10 @@ def upload_to_servergitmirror(
local_repo.index.commit("fdroidserver git-mirror")
# only deploy to GitLab Artifacts if too big for GitLab Pages
if common.get_dir_size(fdroid_dir) <= common.GITLAB_COM_PAGES_MAX_SIZE:
if (
is_index_only
or common.get_dir_size(fdroid_dir) <= common.GITLAB_COM_PAGES_MAX_SIZE
):
gitlab_ci_job_name = 'pages'
else:
gitlab_ci_job_name = 'GitLab Artifacts'

View File

@ -1534,7 +1534,10 @@ def get_mirror_service_urls(mirror):
urls.append('/'.join(segments))
elif hostname == "gitlab.com":
git_mirror_path = os.path.join('git-mirror', folder)
if common.get_dir_size(git_mirror_path) <= common.GITLAB_COM_PAGES_MAX_SIZE:
if (
mirror.get('index_only')
or common.get_dir_size(git_mirror_path) <= common.GITLAB_COM_PAGES_MAX_SIZE
):
# Gitlab-like Pages segments "https://user.gitlab.io/repo/folder"
gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder]
urls.append('/'.join(gitlab_pages))