Pass environment variable

This commit is contained in:
Shiming Zhang 2021-09-14 11:00:05 +08:00
parent 81c2f75375
commit 8b5190e06c
1 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,9 @@ set -o errexit
set -o nounset
set -o pipefail
DEBUG="${DEBUG:-}"
INCREMENTAL="${INCREMENTAL:-}"
declare -A DOMAIN_MAP=()
for line in $(cat ./domain.txt); do
@ -58,7 +61,7 @@ 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}" 2>&1 | tee -a "${LOGFILE}" || {
DEBUG="${DEBUG}" INCREMENTAL="${INCREMENTAL}" EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" 2>&1 | tee -a "${LOGFILE}" || {
echo "Error: diff image ${line} ${new_image}"
}
done