diff --git a/modules/openstack_project/files/mirror/centos-mirror-update.sh b/modules/openstack_project/files/mirror/centos-mirror-update.sh index 647b96b612..541bcfcf6b 100755 --- a/modules/openstack_project/files/mirror/centos-mirror-update.sh +++ b/modules/openstack_project/files/mirror/centos-mirror-update.sh @@ -24,28 +24,50 @@ fi BASE="/afs/.openstack.org/mirror/centos" MIRROR="rsync://mirror.lstn.net" +MIRROR_ALTARCH="rsync://mirror.freethought-internet.co.uk/centos-altarch/" K5START="k5start -t -f /etc/centos.keytab service/centos-mirror -- $TIMEOUT" -REPO=7 -if ! [ -f $BASE/$REPO ]; then - $K5START mkdir -p $BASE/$REPO -fi +REPOS="7 altarch/7" +ALTARCHS="aarch64 ppc64le" +ALTARCHS_IGNORED="armhfp i386 power9 ppc64 x86_64" # altarch/kernel/ has x86_64 dir we do not want -date --iso-8601=ns -echo "Running rsync..." -$K5START rsync -rlptDvz \ +for REPO in $REPOS; do + if ! [ -f $BASE/$REPO ]; then + $K5START mkdir -p $BASE/$REPO + fi + + MIRROR_PATH=$MIRROR/$REPO/ + EXTRA_OPTS="--links" # -l + if [[ $REPO == "altarch"* ]]; then + MIRROR_PATH=$MIRROR_ALTARCH/7/ + EXTRA_OPTS="--copy-links" # copy because altarch has symlinks to ../7.6.1810/ + + for arch in $ALTARCHS_IGNORED; do + EXTRA_OPTS="$EXTRA_OPTS --exclude=$arch" + done + for arch in $ALTARCHS; do + EXTRA_OPTS="$EXTRA_OPTS --include *.${arch}.rpm" + done + fi + + date --iso-8601=ns + echo "Running rsync..." + $K5START rsync -rptDvz \ --delete \ --delete-excluded \ --exclude="atomic" \ --exclude="centosplus" \ + --exclude="experimental" \ --exclude="fasttrack" \ --exclude="isos" \ --exclude="paas" \ --exclude="sclo" \ - --exclude="x86_64/drpms" \ - $MIRROR/centos/$REPO/ $BASE/$REPO/ + --exclude="*/drpms" \ + $EXTRA_OPTS \ + $MIRROR_PATH $BASE/$REPO/ -# TODO(pabelanger): Validate rsync process + # TODO(pabelanger): Validate rsync process +done date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release."