#!/usr/bin/bash # SPDX-License-Identifier: MIT-0 set -euo pipefail TAG="{{ koji_build_tag }}" KEY_ID="$1" LOG_FILE="/var/log/mxos-dist-repo-trigger.log" # Log all output to log file exec > >(tee -a "$LOG_FILE") 2>&1 echo "[$(date -Iseconds)] Triggering dist-repo for tag $TAG with key $KEY_ID..." # Run dist-repo task in Koji and wait for it to complete if /usr/bin/sudo -u kojiadmin /usr/bin/koji dist-repo "$TAG" "$KEY_ID" \ --with-src --split-debuginfo --write-signed-rpms --allow-missing-signatures --wait; then echo "[$(date -Iseconds)] dist-repo completed successfully. Invoking repository synchronization..." /usr/local/bin/mxos-repo-sync.sh else echo "[$(date -Iseconds)] dist-repo task failed. Skipping repository synchronization." >&2 exit 1 fi