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>
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