Add badge

This commit is contained in:
Shiming Zhang 2021-09-13 18:45:42 +08:00
parent 97a9b7e48c
commit a15952860a
1 changed files with 10 additions and 1 deletions

View File

@ -38,6 +38,8 @@ for line in $(cat not_sync.yaml | yq -j '.not_sync[] | .image_pattern , "=", (.t
EXCLUDED_MAP["${key}"]="${val}"
done
LOGFILE="./check-image.log"
for line in $(cat ./mirror.txt); do
line="${line/ /}"
if [[ "$line" == "" ]]; then
@ -55,7 +57,14 @@ for line in $(cat ./mirror.txt); do
domain="${line%%/*}"
new_image=$(echo "${line}" | sed "s/^${domain}/${DOMAIN_MAP["${domain}"]}/g")
echo "Diff image ${line} ${new_image}"
DEBUG=true INCREMENTAL=true EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" || {
DEBUG=true INCREMENTAL=true EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" | tee -a "${LOGFILE}" || {
echo "Error: diff image ${line} ${new_image}"
}
done
sync=$(cat "${LOGFILE}" | grep " SYNC: " | wc -l | tr -d ' ')
nosync=$(cat "${LOGFILE}" | grep " NOSYNC: " | wc -l | tr -d ' ')
sum=$(($sync + $nosync))
echo https://img.shields.io/badge/Sync-${sync}%2F${sum}-blue
wget "https://img.shields.io/badge/Sync-${sync}%2F${sum}-blue" -O sync.svg