Merge "centos-mirror-update: handle non-x86 architectures"

This commit is contained in:
Zuul 2019-06-06 00:57:09 +00:00 committed by Gerrit Code Review
commit 8b98aff89c

View File

@ -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."