From 252e86518f6450633e7b21bfc3f56ef8ed476e90 Mon Sep 17 00:00:00 2001 From: Jamie Murphy Date: Sat, 5 Aug 2023 01:05:05 +0100 Subject: [PATCH] add a nightly_latest.repo file which always points to latest nightly build --- tools/pkg/repo/create.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 0e46cd8ca75..88f4da9a02e 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -477,10 +477,12 @@ def rpm( if salt_repo_user and salt_repo_pass: repo_domain = f"{salt_repo_user}:{salt_repo_pass}@{repo_domain}" - def _create_repo_file(create_repo_path, url_suffix): + def _create_repo_file(create_repo_path, url_suffix, nightly_path=None): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime('%Y-%m-%d')}/" + if not nightly_path: + nightly_path = datetime.utcnow().strftime("%Y-%m-%d") + base_url = f"salt-dev/{nightly_build_from}/{nightly_path}/" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" @@ -523,6 +525,9 @@ def rpm( _create_repo_file(repo_file_path, f"minor/{salt_version}") if nightly_build_from: + nightly_latest_repo_file_path = create_repo_path.parent / "nightly_latest.repo" + _create_repo_file(nightly_latest_repo_file_path, "minor/nightly", "nightly") + nightly_link = create_repo_path.parent / "minor/nightly" ctx.info(f"Creating '{nightly_link.relative_to(repo_path)}' symlink ...") nightly_link.symlink_to(f"minor/{salt_version}")