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