1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-11 01:40:11 +01:00

Merge branch 'index-only-follow-up' into 'master'

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

See merge request fdroid/fdroidserver!1493
This commit is contained in:
Hans-Christoph Steiner 2024-07-03 09:30:23 +00:00
commit 7a9945ce88
2 changed files with 10 additions and 3 deletions

View File

@ -797,7 +797,10 @@ def upload_to_servergitmirror(
local_repo.index.commit("fdroidserver git-mirror") local_repo.index.commit("fdroidserver git-mirror")
# only deploy to GitLab Artifacts if too big for GitLab Pages # 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' gitlab_ci_job_name = 'pages'
else: else:
gitlab_ci_job_name = 'GitLab Artifacts' gitlab_ci_job_name = 'GitLab Artifacts'
@ -1367,7 +1370,8 @@ def main():
# update_servergitmirrors will take care of multiple mirrors so don't need a foreach # update_servergitmirrors will take care of multiple mirrors so don't need a foreach
update_servergitmirrors(config['servergitmirrors'], repo_section) update_servergitmirrors(config['servergitmirrors'], repo_section)
if config.get('awsbucket'): if config.get('awsbucket'):
update_awsbucket(repo_section, options.verbose, options.quiet) index_only = config.get('awsbucket_index_only')
update_awsbucket(repo_section, index_only, options.verbose, options.quiet)
if config.get('androidobservatory'): if config.get('androidobservatory'):
upload_to_android_observatory(repo_section) upload_to_android_observatory(repo_section)
if config.get('virustotal_apikey'): if config.get('virustotal_apikey'):

View File

@ -1534,7 +1534,10 @@ def get_mirror_service_urls(mirror):
urls.append('/'.join(segments)) urls.append('/'.join(segments))
elif hostname == "gitlab.com": elif hostname == "gitlab.com":
git_mirror_path = os.path.join('git-mirror', folder) 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-like Pages segments "https://user.gitlab.io/repo/folder"
gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder] gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder]
urls.append('/'.join(gitlab_pages)) urls.append('/'.join(gitlab_pages))