1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-21 04:10:37 +02:00

style(deploy): rename working_dir_root variable to workspace_dir

This commit is contained in:
proletarius101 2024-06-05 03:52:02 +08:00
parent f321f62904
commit f27ecd1674
No known key found for this signature in database

View File

@ -633,11 +633,11 @@ def update_servergitmirrors(servergitmirrors, repo_section):
return return
options = common.get_options() options = common.get_options()
working_dir_root = Path(os.getcwd()) workspace_dir = Path(os.getcwd())
# right now we support only 'repo' git-mirroring # right now we support only 'repo' git-mirroring
if repo_section == 'repo': if repo_section == 'repo':
git_mirror_path = working_dir_root / 'git-mirror' git_mirror_path = workspace_dir / 'git-mirror'
dotgit = os.path.join(git_mirror_path, '.git') dotgit = os.path.join(git_mirror_path, '.git')
git_fdroiddir = os.path.join(git_mirror_path, 'fdroid') git_fdroiddir = os.path.join(git_mirror_path, 'fdroid')
git_repodir = os.path.join(git_fdroiddir, repo_section) git_repodir = os.path.join(git_fdroiddir, repo_section)
@ -702,9 +702,9 @@ def update_servergitmirrors(servergitmirrors, repo_section):
# trailing slashes have a meaning in rsync which is not needed here, so # trailing slashes have a meaning in rsync which is not needed here, so
# make sure both paths have exactly one trailing slash # make sure both paths have exactly one trailing slash
if is_index_only: if is_index_only:
files_to_sync = [str(working_dir_root / repo_section / index_file) for index_file in INDEX_FILES] files_to_sync = [str(workspace_dir / repo_section / index_file) for index_file in INDEX_FILES]
else: else:
files_to_sync = [str(working_dir_root / repo_section).rstrip('/') + '/'] files_to_sync = [str(workspace_dir / repo_section).rstrip('/') + '/']
common.local_rsync(common.get_options(), common.local_rsync(common.get_options(),
files_to_sync, files_to_sync,
git_repodir.rstrip('/') + '/') git_repodir.rstrip('/') + '/')
@ -809,7 +809,7 @@ def upload_to_servergitmirror(mirror_config: Dict[str, str],
local_repo.index.add(['.gitlab-ci.yml']) local_repo.index.add(['.gitlab-ci.yml'])
local_repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages") local_repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages")
logging.debug(_('Pushing to {url}').format(url=remote.url)) logging.info(_('Pushing to {url}').format(url=remote.url))
with local_repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd): with local_repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
pushinfos = remote.push( pushinfos = remote.push(
f"{local_branch_name}:{remote_branch_name}", force=True, set_upstream=True, progress=progress f"{local_branch_name}:{remote_branch_name}", force=True, set_upstream=True, progress=progress