From 19c47c3c20ed7057f51db844682728464e22a726 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Sep 06 2024 16:51:21 +0000 Subject: Keep metadata where it won't be garbage collected Signed-off-by: Stephen Gallagher --- diff --git a/eln-nightly.sh b/eln-nightly.sh index 76b27df..780c155 100755 --- a/eln-nightly.sh +++ b/eln-nightly.sh @@ -5,6 +5,8 @@ export LC_ALL=C CONFIG="eln.conf" TARGET_DIR="/mnt/koji/compose/eln" +MD_ARCHIVE_DIR="/mnt/koji/compose/metadata-archive" +SERIES_DIR="$MD_ARCHIVE_DIR/series" NIGHTLY="--nightly" SKIP_PHASES="" DEST=$(pwd) @@ -105,6 +107,15 @@ for tomail in $TOMAIL ; do mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail done +# Copy the metadata to the non-garbage-collected metadata archive +YEAR=$(echo "${SHORTCOMPOSE_ID}" | cut -c1-4) +mkdir -p "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ID}" +cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ID}/" +# Add the compose ID to the 'series' file which records the +# compose IDs for each SHORT name in order +mkdir -p "${SERIES_DIR}" +echo "${NEWCOMPOSE_ID}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" + # Removed all the older than 14 days composes find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \; send_fedora_message "${fedora_message_json_done}" ${RELEASE} cleanup.complete