summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-25 15:44:55 +0100
committerErich Eckner <git@eckner.net>2017-11-25 15:44:55 +0100
commit235b0a01b941a9a1638a68fe59fb71348550bc2a (patch)
treef041fe1766c4e579d2bc1606f10b14affb601f46
parentaae4b0f5b4fae609a9dd2fb11e99d5f1b7965c34 (diff)
downloadbuilder-235b0a01b941a9a1638a68fe59fb71348550bc2a.tar.xz
bin/build-packages: try uploading of error report again in case of error
-rwxr-xr-xbin/build-packages35
1 files changed, 27 insertions, 8 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 3bb0f8a..343caad 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -454,14 +454,33 @@ while [ "${count}" -ne 0 ]; do
if ${upload_to_build_master} && \
tar -cf 'build-logs.gz.tar' \
-- *'.build-log.gz'; then
- while ! ssh \
- -i "${master_build_server_identity}" \
- -p "${master_build_server_port}" \
- "${master_build_server_user}@${master_build_server}" \
- 'return-assignment' "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" 'ERROR' < \
- 'build-logs.gz.tar'; do
- >&2 echo 'There was an error during the upload of the package, I will try again.'
- wait_some_time 15
+ while true; do
+ err=0
+ # shellcheck disable=SC2029
+ ssh \
+ -i "${master_build_server_identity}" \
+ -p "${master_build_server_port}" \
+ "${master_build_server_user}@${master_build_server}" \
+ 'return-assignment' "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" 'ERROR' \
+ < 'build-logs.gz.tar' || \
+ err=$?
+ case ${err} in
+ 0)
+ # upload successful
+ break
+ ;;
+ 1)
+ >&2 echo '"return-assignment" was running already.'
+ wait_some_time 15
+ ;;
+ 2)
+ >&2 echo 'I was too slow, the package is outdated. I will continue ...'
+ break
+ ;;
+ *)
+ >&2 echo "unknown return code ${err} from 'return-assignment'"
+ wait_some_time 60
+ esac
done
fi
if ${exit_after_failure}; then