From 0901c4509ba5a2e639d991f753259439ced503b4 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 11 Sep 2023 12:58:50 -0700 Subject: [PATCH] Cleanup the Fedora 36 mirror content This is mostly a formality as upstream of us the content was already removed and we synced that removal. But this will do a little extra cleanup for us to make it look even less like a mirror of Fedora 36. I also kept the structure of the file rather than deleting the code to sync Fedora content. This should make it easy for someone to pick this back up in the future if there is a need and ability to maintain it. Change-Id: I976304727a06bd36eb05201043aac3861ee66937 --- .../mirror-update/files/fedora-mirror-update | 123 ++++++++++-------- 1 file changed, 70 insertions(+), 53 deletions(-) diff --git a/playbooks/roles/mirror-update/files/fedora-mirror-update b/playbooks/roles/mirror-update/files/fedora-mirror-update index fd6335693c..9b1873c722 100755 --- a/playbooks/roles/mirror-update/files/fedora-mirror-update +++ b/playbooks/roles/mirror-update/files/fedora-mirror-update @@ -38,63 +38,80 @@ echo_ts "----- START FEDORA MIRROR RSYNC RUN -----" # Purge old releases echo_ts "Purging old mirrors" -$K5START rm -rf $BASE/releases/35 $BASE/updates/35 $BASE/releases/37 $BASE/updates/37 $BASE/development/rawhide +$K5START rm -rf $BASE/releases/35 $BASE/updates/35 $BASE/releases/36 $BASE/updates/36 $BASE/releases/37 $BASE/updates/37 $BASE/development/rawhide -for REPO in releases/36; do - if ! [ -f $BASE/$REPO ]; then - $K5START mkdir -p $BASE/$REPO - fi +# We set RELEASE_REPOS and UPDATE_REPOS to empty strings to fail +# the conditions below skipping any rsyncing. We don't just simply +# exit 0 here because we do need the vos release at the end to run +# and publish the cleanups done by the rm above. +# +# The code below isn't simply removed to make it easy for people to +# resurrect this in the future should conditions change making +# fedora test nodes a more viable option again. - echo_ts "Running rsync for $REPO..." - $K5START rsync -rltvz \ - --delete \ - --delete-excluded \ - --exclude="iso/" \ - --exclude="images/" \ - --exclude="isolinux/" \ - --exclude="Cloud/x86_64/images/*.box" \ - --exclude="Container" \ - --exclude="Kinoite" \ - --exclude="Server" \ - --exclude="Silverblue" \ - --exclude="Spins" \ - --exclude="Workstation" \ - --exclude="aarch64/" \ - --exclude="armhfp/" \ - --exclude="source/" \ - --exclude="x86_64/debug/" \ - --exclude="x86_64/drpms/" \ - --exclude="snapshot/" \ - --exclude=".~tmp~/" \ - --exclude=".private/" \ - --exclude=".nfs*" \ - $MIRROR/$REPO/ $BASE/$REPO/ - echo_ts "... done" -done +# A list of release repos to sync eg 'releases/36 releases/37' +RELEASE_REPOS='' +if [ -n "$RELEASE_REPOS" ]; then + for REPO in "$RELEASE_REPOS"; do + if ! [ -f $BASE/$REPO ]; then + $K5START mkdir -p $BASE/$REPO + fi -for REPO in updates/36; do - if ! [ -f $BASE/$REPO ]; then - $K5START mkdir -p $BASE/$REPO - fi + echo_ts "Running rsync for $REPO..." + $K5START rsync -rltvz \ + --delete \ + --delete-excluded \ + --exclude="iso/" \ + --exclude="images/" \ + --exclude="isolinux/" \ + --exclude="Cloud/x86_64/images/*.box" \ + --exclude="Container" \ + --exclude="Kinoite" \ + --exclude="Server" \ + --exclude="Silverblue" \ + --exclude="Spins" \ + --exclude="Workstation" \ + --exclude="aarch64/" \ + --exclude="armhfp/" \ + --exclude="source/" \ + --exclude="x86_64/debug/" \ + --exclude="x86_64/drpms/" \ + --exclude="snapshot/" \ + --exclude=".~tmp~/" \ + --exclude=".private/" \ + --exclude=".nfs*" \ + $MIRROR/$REPO/ $BASE/$REPO/ + echo_ts "... done" + done +fi - echo_ts "Running rsync for $REPO..." - $K5START rsync -rltvz \ - --delete \ - --delete-excluded \ - --exclude="aarch64/" \ - --exclude="armhfp/" \ - --exclude="i386/" \ - --exclude="source/" \ - --exclude="SRPMS/" \ - --exclude="x86_64/debug" \ - --exclude="x86_64/drpms" \ - --exclude="snapshot/" \ - --exclude=".~tmp~/" \ - --exclude=".private/" \ - --exclude=".nfs*" \ - $MIRROR/$REPO/ $BASE/$REPO/ - echo_ts "... done" -done +# A list of update repos to sync eg 'updates/36 updates/37' +UPDATE_REPOS='' +if [ -n "$UPDATE_REPOS" ]; then + for REPO in "$UPDATE_REPOS"; do + if ! [ -f $BASE/$REPO ]; then + $K5START mkdir -p $BASE/$REPO + fi + + echo_ts "Running rsync for $REPO..." + $K5START rsync -rltvz \ + --delete \ + --delete-excluded \ + --exclude="aarch64/" \ + --exclude="armhfp/" \ + --exclude="i386/" \ + --exclude="source/" \ + --exclude="SRPMS/" \ + --exclude="x86_64/debug" \ + --exclude="x86_64/drpms" \ + --exclude="snapshot/" \ + --exclude=".~tmp~/" \ + --exclude=".private/" \ + --exclude=".nfs*" \ + $MIRROR/$REPO/ $BASE/$REPO/ + echo_ts "... done" + done +fi # TODO(pabelanger): Validate rsync process