mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Export the GPG key being used to the top level directory too.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
e5c58d9ab9
commit
ed456d6925
1 changed files with 44 additions and 2 deletions
|
@ -197,6 +197,16 @@ def debian(
|
|||
}}
|
||||
"""
|
||||
ctx.info("Creating repository directory structure ...")
|
||||
create_repo_path = _create_top_level_repo_path(
|
||||
repo_path,
|
||||
salt_version,
|
||||
distro,
|
||||
distro_version=distro_version,
|
||||
distro_arch=distro_arch,
|
||||
)
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
create_repo_path = _create_repo_path(
|
||||
repo_path,
|
||||
salt_version,
|
||||
|
@ -205,7 +215,6 @@ def debian(
|
|||
distro_arch=distro_arch,
|
||||
nightly_build=nightly_build,
|
||||
)
|
||||
|
||||
ftp_archive_config_file = create_repo_path / "apt-ftparchive.conf"
|
||||
ctx.info(f"Writing {ftp_archive_config_file} ...")
|
||||
ftp_archive_config_file.write_text(textwrap.dedent(ftp_archive_config))
|
||||
|
@ -400,6 +409,16 @@ def rpm(
|
|||
distro_arch = "arm64"
|
||||
|
||||
ctx.info("Creating repository directory structure ...")
|
||||
create_repo_path = _create_top_level_repo_path(
|
||||
repo_path,
|
||||
salt_version,
|
||||
distro,
|
||||
distro_version=distro_version,
|
||||
distro_arch=distro_arch,
|
||||
)
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
create_repo_path = _create_repo_path(
|
||||
repo_path,
|
||||
salt_version,
|
||||
|
@ -1447,6 +1466,14 @@ def _create_onedir_based_repo(
|
|||
pkg_suffixes: tuple[str, ...],
|
||||
):
|
||||
ctx.info("Creating repository directory structure ...")
|
||||
create_repo_path = _create_top_level_repo_path(
|
||||
repo_path,
|
||||
salt_version,
|
||||
distro,
|
||||
)
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
create_repo_path = _create_repo_path(
|
||||
repo_path, salt_version, distro, nightly_build=nightly_build
|
||||
)
|
||||
|
@ -1788,7 +1815,7 @@ def _publish_repo(
|
|||
pass
|
||||
|
||||
|
||||
def _create_repo_path(
|
||||
def _create_top_level_repo_path(
|
||||
repo_path: pathlib.Path,
|
||||
salt_version: str,
|
||||
distro: str,
|
||||
|
@ -1806,6 +1833,21 @@ def _create_repo_path(
|
|||
create_repo_path = create_repo_path / distro_version
|
||||
if distro_arch:
|
||||
create_repo_path = create_repo_path / distro_arch
|
||||
create_repo_path.mkdir(exist_ok=True, parents=True)
|
||||
return create_repo_path
|
||||
|
||||
|
||||
def _create_repo_path(
|
||||
repo_path: pathlib.Path,
|
||||
salt_version: str,
|
||||
distro: str,
|
||||
distro_version: str | None = None, # pylint: disable=bad-whitespace
|
||||
distro_arch: str | None = None, # pylint: disable=bad-whitespace
|
||||
nightly_build: bool = False,
|
||||
):
|
||||
create_repo_path = _create_top_level_repo_path(
|
||||
repo_path, salt_version, distro, distro_version, distro_arch
|
||||
)
|
||||
if nightly_build is False:
|
||||
create_repo_path = create_repo_path / "minor" / salt_version
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue