Adding f27 to sync script so that f27 updats get onto master mirror

Signed-off-by: Mohan Boddu <mboddu@redhat.com>
This commit is contained in:
Mohan Boddu 2017-08-18 22:35:38 +00:00
parent 9270b6bac8
commit e1392df7ba

View file

@ -8,8 +8,12 @@ ATOMICDEST=/mnt/koji/atomic/
OPTIONS="-rlptDvHh --stats --delay-updates $RSYNC_OPTS"
#f26 exlcude
PRIMARY_EXCLUDES_26=" --exclude=aarch64 --exclude=i386 --exclude=ppc64 --exclude=ppc64le --exclude=s390x "
ALT_EXCLUDES_26=" --exclude=armhfp --exclude=SRPMS --exclude=x86_64 --exclude=s390x"
#f27 and above exlcudes
PRIMARY_EXCLUDES=" --exclude=aarch64 --exclude=i386 --exclude=ppc64 --exclude=ppc64le --exclude=s390x "
ALT_EXCLUDES=" --exclude=armhfp --exclude=SRPMS --exclude=x86_64 --exclude=s390x"
ALT_EXCLUDES=" --exclude=armhfp --exclude=SRPMS --exclude=x86_64 "
#old style simple sync
for rel in 25; do
@ -57,6 +61,93 @@ done
#new style primary sync
for rel in 26; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES_26 \
$SOURCE/f$rel-updates/ $DEST/$rel/ --link-dest $DEST/testing/$rel/)
OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $PRIMARY_EXCLUDES_26 --exclude=Live --exclude=Images \
$SOURCE/f$rel-updates/ $DEST/$rel/)
# Grep out some signals from the stats
bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
# If anything changed, then publish a fedmsg message as bodhi.updates.sync
if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates\", \"release\": \"$rel\"}" | fedmsg-logger \
--cert-prefix ftpsync \
--modname bodhi \
--topic updates.fedora.sync \
--json-input &> /dev/null
fi
done
for rel in 26; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES_26 \
$SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $PRIMARY_EXCLUDES_26 --exclude=Live --exclude=Images \
$SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
# Grep out some signals from the stats
bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
# If anything changed, then publish a fedmsg message as bodhi.updates.sync
if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates-testing\", \"release\": \"$rel\"}" | fedmsg-logger \
--cert-prefix ftpsync \
--modname bodhi \
--topic updates.fedora.sync \
--json-input &> /dev/null
fi
done
# new style alternative sync
for rel in 26; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES_26 \
$SOURCE/f$rel-updates/ $ALTDEST/$rel/ --link-dest $ALTDEST/testing/$rel/)
OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $ALT_EXCLUDES_26 --exclude=Live --exclude=Images \
$SOURCE/f$rel-updates/ $ALTDEST/$rel/)
# Grep out some signals from the stats
bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
# If anything changed, then publish a fedmsg message as bodhi.updates.sync
if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates\", \"release\": \"$rel\"}" | fedmsg-logger \
--cert-prefix ftpsync \
--modname bodhi \
--topic updates.fedora.sync \
--json-input &> /dev/null
fi
done
for rel in 26; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES_26 \
$SOURCE/f$rel-updates-testing/ $ALTDEST/testing/$rel/)
OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $ALT_EXCLUDES_26 --exclude=Live --exclude=Images \
$SOURCE/f$rel-updates-testing/ $ALTDEST/testing/$rel/)
# Grep out some signals from the stats
bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
# If anything changed, then publish a fedmsg message as bodhi.updates.sync
if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates-testing\", \"release\": \"$rel\"}" | fedmsg-logger \
--cert-prefix ftpsync \
--modname bodhi \
--topic updates.fedora.sync \
--json-input &> /dev/null
fi
done
#new style primary sync for f27 and above
for rel in 27; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES \
$SOURCE/f$rel-updates/ $DEST/$rel/ --link-dest $DEST/testing/$rel/)
OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $PRIMARY_EXCLUDES --exclude=Live --exclude=Images \
@ -76,7 +167,7 @@ for rel in 26; do
fi
done
for rel in 26; do
for rel in 27; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES \
$SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
@ -97,8 +188,8 @@ for rel in 26; do
fi
done
# new style alternative sync
for rel in 26; do
# new style alternative sync for f27 and above
for rel in 27; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES \
$SOURCE/f$rel-updates/ $ALTDEST/$rel/ --link-dest $ALTDEST/testing/$rel/)
@ -119,7 +210,7 @@ for rel in 26; do
fi
done
for rel in 26; do
for rel in 27; do
OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES \
$SOURCE/f$rel-updates-testing/ $ALTDEST/testing/$rel/)
@ -141,7 +232,7 @@ for rel in 26; do
done
for rel in 25 26; do
for rel in 25 26 27; do
OUTPUT1=$(rsync $OPTIONS --ignore-existing \
$ATOMICSOURCE/$rel/objects/ $ATOMICDEST/$rel/objects/)