Moves the upload into a separate Drone command and adds a timeout for curl
to fail after 15 minutes.
Returns zero to keep Drone from failing.
Signed-off-by: Michael Schuster <michael@schuster.ms>
image: nextcloudci/client-5.12:client-5.12-5
commands:
- /bin/bash -c "./admin/linux/build-appimage.sh"
+ - /bin/bash -c "./admin/linux/upload-appimage.sh"
trigger:
branch:
- master
./squashfs-root/AppRun ${DESKTOP_FILE} -appimage
mv Nextcloud*.AppImage Nextcloud-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage
-
-curl --upload-file $(readlink -f ./Nextcloud*.AppImage) https://transfer.sh/Nextcloud-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage
-
-echo
-echo "Get the AppImage at the link above!"
--- /dev/null
+#! /bin/bash
+
+set -xe
+
+# Upload AppImage
+APPIMAGE=$(readlink -f ./Nextcloud*.AppImage)
+BASENAME=$(basename ${APPIMAGE})
+
+if curl --max-time 900 --upload-file ${APPIMAGE} https://transfer.sh/${BASENAME}
+then
+ echo
+ echo "Get the AppImage at the link above!"
+else
+ echo
+ echo "Upload failed, however this is an optional step."
+fi
+
+# Don't let the Drone build fail
+exit 0
\ No newline at end of file