Add a timeout for verify-repo-built-successful.py

This commit is contained in:
Gustavo Yokoyama Ribeiro 2023-01-24 13:48:47 -03:00
parent 9e328db488
commit b0c4abff68

View File

@ -11,10 +11,12 @@ logger() {
polling_repo() {
logger "[CHECKING] Checking standard repository from ${PROJECT}"
OUTPUT=$(/usr/share/openSUSE-release-tools/verify-repo-built-successful.py -A ${API_URL} -p ${PROJECT} -r standard 2>&1)
OUTPUT=$(timeout 3m /usr/share/openSUSE-release-tools/verify-repo-built-successful.py -A ${API_URL} -p ${PROJECT} -r standard 2>&1)
RETURNCODE=$?
if [ ${RETURNCODE} -eq 0 ]; then
logger "[READY] Repository is NOT building"
elif [ ${RETURNCODE} -eq 124 ]; then
logger "[TIMEOUT] Verifying repository status reaches a timeout"
else
case ${OUTPUT} in
*"Repository "*" is not yet finished"*)
@ -61,6 +63,10 @@ if [ $? -eq 3 ]; then
# Continue polling repository results: Repository is still building
continue
;;
124)
# Retry polling repository results: Verifying repository results reaches a timeout
continue
;;
*)
# Stop polling repository results: Failed polling results
exit 1