Browse Source

Make AppImage upload optional and add timeout

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>
Michael Schuster 6 years ago
parent
commit
4fc8936553
3 changed files with 20 additions and 5 deletions
  1. 1 0
      .drone.yml
  2. 0 5
      admin/linux/build-appimage.sh
  3. 19 0
      admin/linux/upload-appimage.sh

+ 1 - 0
.drone.yml

@@ -322,6 +322,7 @@ steps:
   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

+ 0 - 5
admin/linux/build-appimage.sh

@@ -100,8 +100,3 @@ export LD_LIBRARY_PATH=/app/usr/lib/
 ./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!"

+ 19 - 0
admin/linux/upload-appimage.sh

@@ -0,0 +1,19 @@
+#! /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