b5938: Add notify operators to update_tra...urls

This commit is contained in:
Thomas Stokes committed 2023-12-21 09:41:31 +00:00
1 parent e283a86530
commit 88edaaba00
1 file changed
+2 -1
@@ -3,9 +3,10 @@ GIT_ROOT=/home/wiki/gitwiki
PATH_TO_TRAC_TRAC_URLS="configuration/tractrac-json-urls"
urls=$(mongo --quiet "mongodb://dbserver.internal.sapsailing.com:10201/winddb?replicaSet=archive" --eval 'db.TRACTRAC_CONFIGURATIONS.find({}, {TT_CONFIG_JSON_URL : 1}).toArray()' | grep -v ObjectId | jq -r '.[].TT_CONFIG_JSON_URL' )
if [[ $urls == "null" ]]; then
echo "Mongo db returns null for tractrac url discovery" | notify-operators "MongoDB/tractrac urls issue"
exit 1
else
echo ${urls} | sort -u >"${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
echo ${urls} | sort -u >"${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
fi
cd "${GIT_ROOT}"
git add "${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"