]> git.ipfire.org Git - people/ms/nightly-builds.git/commitdiff
Retry uploads
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 May 2016 22:29:43 +0000 (00:29 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 May 2016 22:29:43 +0000 (00:29 +0200)
This change will allow us to keep a build and let the
script retry uploading that later. This just works around
connection resets, etc.

When an upload was successful all builds will be removed
from the local disk.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
build.sh

index fae811c6ac43ebeb14319aa5148e2d0718a1ad88..0c17868f2ba082db35eab7a3158c30ecf96c5d2a 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -94,12 +94,16 @@ build() {
                fi
                mv -v log/ "${build}"
 
-               # Upload the result
-               sync
-
-               # Cleanup in the end
+               # Cleanup the build environment
                ./make.sh --target="${target}" clean
-               rm -rf "${build_path}"
+
+               # Upload the result
+               # If that failed, we will keep the result and it will
+               # be retried with the next build. If that succeeded, the
+               # build will be removed from disk.
+               if sync; then
+                       rm -rf "${build_path}"
+               fi
        done
 
        popd