s3-mirror: only skip repomd.xml files in first sync run

.. and include _only_ those in second sync run.
This commit is contained in:
Pavel Raiskup 2020-03-23 06:50:48 +01:00 committed by Pierre-Yves Chibon
parent 19f148c842
commit 164bd1e7a9

View file

@ -3,9 +3,9 @@
# LGPL # LGPL
# Author: Rick Elrod <relrod@redhat.com> # Author: Rick Elrod <relrod@redhat.com>
base_cmd=( aws_sync=( aws s3 sync --no-follow-symlinks )
aws s3 sync
--no-follow-symlinks excludes=(
--exclude "*/.snapshot/*" --exclude "*/.snapshot/*"
--exclude "*/source/*" --exclude "*/source/*"
--exclude "*/SRPMS/*" --exclude "*/SRPMS/*"
@ -89,14 +89,15 @@ base_cmd=(
) )
# First run this command that syncs, but does not delete. # First run this command that syncs, but does not delete.
# It also excludes repodata. # It also excludes repomd.xml.
CMD1=( "${base_cmd[@]}" --exclude "*/repodata/*" ) CMD1=( "${aws_sync[@]}" "${excludes[@]}" --exclude "*/repomd.xml" )
# Next we run this command which also includes repodata. # Next we run this command which syncs repomd.xml files. Include must precede
CMD2=( "${base_cmd[@]}" ) # the large set of excludes.
CMD2=( "${aws_sync[@]}" --exclude "*" --include "*/repomd.xml" "${excludes[@]}" )
# Then we delete old RPMs and old metadata (but after invalidating caches). # Then we delete old RPMs and old metadata (but after invalidating caches).
CMD3=( "${base_cmd[@]}" --delete ) CMD3=( "${aws_sync[@]}" "${excludes[@]}" --delete )
S3_MIRROR=s3-mirror-us-west-1-02.fedoraproject.org S3_MIRROR=s3-mirror-us-west-1-02.fedoraproject.org
DIST_ID=E2KJMDC0QAJDMU DIST_ID=E2KJMDC0QAJDMU