diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index c6da078ef..0ef2de378 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -218,8 +218,9 @@ jobs: # Publishing repository changes. if [ "$uploaded_files" = "true" ]; then - aptly_add_to_repo - sleep 180 + if ! aptly_add_to_repo; then + exit 1 + fi # Usually temporary directory is deleted automatically, but in certain cases it is left. aptly_delete_dir @@ -256,7 +257,9 @@ jobs: # Publishing repository changes. 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. aptly_delete_dir diff --git a/scripts/aptly_api.sh b/scripts/aptly_api.sh index df90b1674..a94924701 100644 --- a/scripts/aptly_api.sh +++ b/scripts/aptly_api.sh @@ -75,10 +75,19 @@ aptly_add_to_repo() { echo echo "$warnings" echo + return 1 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 - 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 + return 0 } aptly_publish_repo() {