ci: sleep only when aptly_add_to_repo returns with status code 000
It is just a waste of time to sleep for 3 minutes when the packages are successfully added and aptly returns 200 http code
This commit is contained in:
parent
cac3799e1d
commit
dcaf44f95b
|
@ -218,8 +218,9 @@ jobs:
|
||||||
|
|
||||||
# Publishing repository changes.
|
# Publishing repository changes.
|
||||||
if [ "$uploaded_files" = "true" ]; then
|
if [ "$uploaded_files" = "true" ]; then
|
||||||
aptly_add_to_repo
|
if ! aptly_add_to_repo; then
|
||||||
sleep 180
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Usually temporary directory is deleted automatically, but in certain cases it is left.
|
# Usually temporary directory is deleted automatically, but in certain cases it is left.
|
||||||
aptly_delete_dir
|
aptly_delete_dir
|
||||||
|
@ -256,7 +257,9 @@ jobs:
|
||||||
|
|
||||||
# Publishing repository changes.
|
# Publishing repository changes.
|
||||||
if [ "$uploaded_files" = "true" ]; then
|
if [ "$uploaded_files" = "true" ]; then
|
||||||
aptly_add_to_repo
|
if ! aptly_add_to_repo; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Usually temporary directory is deleted automatically, but in certain cases it is left.
|
# Usually temporary directory is deleted automatically, but in certain cases it is left.
|
||||||
aptly_delete_dir
|
aptly_delete_dir
|
||||||
|
|
|
@ -75,10 +75,19 @@ aptly_add_to_repo() {
|
||||||
echo
|
echo
|
||||||
echo "$warnings"
|
echo "$warnings"
|
||||||
echo
|
echo
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
elif [ "$http_status_code" == "000" ]; then
|
||||||
|
echo "[$(date +%H:%M:%S)] Warning: server/proxy dropped connection. Assuming that the host is adding packages inspite of lost connection."
|
||||||
|
echo "[$(date +%H:%M:%S)] Warning: Waiting for host to add packages. Sleeping for 180s. Assuming that packages will be added till then."
|
||||||
|
sleep 180
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
echo "[$(date +%H:%M:%S)] Warning: got http_status_code == '$http_status_code', packages may not appear in repository."
|
echo "[$(date +%H:%M:%S)] Error: got http_status_code == '$http_status_code'."
|
||||||
|
echo "[$(date +%H:%M:%S)] Error: the unexpected happened. Ask any maintainer to check the aptly log"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
aptly_publish_repo() {
|
aptly_publish_repo() {
|
||||||
|
|
Loading…
Reference in New Issue