feat: implement automatic, atomic, and push-based repository synchronization
- Switched from systemd path monitoring to a custom wrapper script `mxos-trigger-dist-repo.sh` spawned by the Koji signing spooler. - Wrapper script runs Koji `dist-repo` synchronously and triggers the `mxos-repo-sync.sh` script to perform an atomic rsync of packages to the Caddy server. - Excluded reposerver from distro-sync to work around VM disk space constraints. - Configured Koji tag `mxos0` to cancel older pending/running `distRepo` tasks when a new one is triggered. - Verified successful repository generation, synchronization, and DNF resolution. Co-developed-by: Gemini AI <renich+gemini@woralelandia.com> Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
This commit is contained in:
parent
70060e9791
commit
38a0669db8
11 changed files with 191 additions and 54 deletions
|
|
@ -244,6 +244,22 @@ def process_queue():
|
|||
try:
|
||||
kojihub.context.cnx.commit()
|
||||
logger.info(f"All signatures committed for build {build_id} ({build_nvr}).")
|
||||
|
||||
# Check tags and trigger dist-repo if tagged in mxos0
|
||||
try:
|
||||
tags = list(kojihub.list_tags(build=build_id))
|
||||
tag_names = [t['name'] for t in tags]
|
||||
logger.info(f"Build {build_nvr} is tagged in: {tag_names}")
|
||||
if 'mxos0' in tag_names:
|
||||
short_key_id = sig_key_id[-8:].lower()
|
||||
logger.info(f"Triggering dist-repo for tag mxos0 with key {short_key_id}")
|
||||
dist_cmd = [
|
||||
'/usr/local/bin/mxos-trigger-dist-repo.sh', short_key_id
|
||||
]
|
||||
subprocess.Popen(dist_cmd)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to check tags/trigger dist-repo: {e}")
|
||||
|
||||
os.remove(file_path)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to commit signatures to database: {e}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue