Merge pull request #524 from github/lildude/update-verify-routes
Cater for more explicit gist paths used in routes file
This commit is contained in:
Коммит
39b2e05069
|
@ -367,8 +367,24 @@ bm_end "$(basename $0) - Special Data Directories Sync"
|
|||
if [ -z "$GHE_SKIP_ROUTE_VERIFICATION" ]; then
|
||||
bm_start "$(basename $0) - Verifying Routes"
|
||||
|
||||
# The list of gists returned by the source changed in 2.16.23, 2.17.14, 2.18.8 & 2.19.3
|
||||
# so we need to account for this difference here.
|
||||
parse_paths() {
|
||||
while read -r line; do
|
||||
if [[ "$GHE_REMOTE_VERSION" =~ 2.16 && "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.16.23)" ]] || \
|
||||
[[ "$GHE_REMOTE_VERSION" =~ 2.17 && "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.17.14)" ]] || \
|
||||
[[ "$GHE_REMOTE_VERSION" =~ 2.18 && "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.18.8)" ]] || \
|
||||
[[ "$GHE_REMOTE_VERSION" =~ 2.19 && "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.19.3)" ]] && \
|
||||
(echo "$line" | grep -q "gist"); then
|
||||
echo "$line"
|
||||
else
|
||||
dirname "$line"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
cat $tempdir/*.rsync | sort | uniq > $tempdir/source_routes
|
||||
(cd $backup_dir/ && find * -mindepth 5 -maxdepth 6 -type d -name \*.git -exec dirname {} \; | sort | uniq) > $tempdir/destination_routes
|
||||
(cd $backup_dir/ && find * -mindepth 5 -maxdepth 6 -type d -name \*.git | parse_paths | sort | uniq) > $tempdir/destination_routes
|
||||
|
||||
git --no-pager diff --unified=0 --no-prefix -- $tempdir/source_routes $tempdir/destination_routes || echo "Warning: One or more repository networks and/or gists were not found on the source appliance. Please contact GitHub Enterprise Support for assistance."
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче