nightly: GitLab URLs end in '.git' to avoid warning and redirects

warning: redirecting to https://gitlab.com/fdroid/fdroidclient-nightly.git/
This commit is contained in:
Hans-Christoph Steiner 2025-06-17 11:28:06 +02:00
parent 98aaf1ba7c
commit 0a5f15dad7
2 changed files with 6 additions and 7 deletions

View file

@ -325,14 +325,13 @@ def main():
if 'CI_PROJECT_PATH' in os.environ and 'CI_PROJECT_URL' in os.environ: if 'CI_PROJECT_PATH' in os.environ and 'CI_PROJECT_URL' in os.environ:
# we are in GitLab CI # we are in GitLab CI
repo_git_base = os.getenv('CI_PROJECT_PATH') + NIGHTLY repo_git_base = os.getenv('CI_PROJECT_PATH') + NIGHTLY
clone_url = os.getenv('CI_PROJECT_URL') + NIGHTLY base_url = f"{os.getenv('CI_PROJECT_URL')}{NIGHTLY}"
clone_url = f'{base_url}.git' # avoid redirects while cloning
repo_base = get_repo_base_url( repo_base = get_repo_base_url(
clone_url, repo_git_base, force_type='gitlab.com' base_url, repo_git_base, force_type='gitlab.com'
)
servergitmirror = 'git@' + urlparse(clone_url).netloc + ':' + repo_git_base
deploy_key_url = (
f'{clone_url}/-/settings/repository#js-deploy-keys-settings'
) )
servergitmirror = f'git@{urlparse(base_url).netloc}:{repo_git_base}.git'
deploy_key_url = f'{base_url}/-/settings/repository#js-deploy-keys-settings'
git_user_name = os.getenv('GITLAB_USER_NAME') git_user_name = os.getenv('GITLAB_USER_NAME')
git_user_email = os.getenv('GITLAB_USER_EMAIL') git_user_email = os.getenv('GITLAB_USER_EMAIL')
elif 'TRAVIS_REPO_SLUG' in os.environ: elif 'TRAVIS_REPO_SLUG' in os.environ:

View file

@ -359,7 +359,7 @@ class NightlyTest(unittest.TestCase):
'repo_keyalias': 'androiddebugkey', 'repo_keyalias': 'androiddebugkey',
'repo_name': 'fdroid/test-nightly', 'repo_name': 'fdroid/test-nightly',
'repo_url': 'https://gitlab.com/fdroid/test-nightly/-/raw/master/fdroid/repo', 'repo_url': 'https://gitlab.com/fdroid/test-nightly/-/raw/master/fdroid/repo',
'servergitmirrors': [{"url": 'git@gitlab.com:fdroid/test-nightly'}], 'servergitmirrors': [{"url": 'git@gitlab.com:fdroid/test-nightly.git'}],
} }
with open(common.CONFIG_FILE) as fp: with open(common.CONFIG_FILE) as fp:
config = yaml.safe_load(fp) config = yaml.safe_load(fp)