2018-03-02 14:08:09 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-02-07 09:28:28 +03:00
|
|
|
#1: LOG_USERNAME
|
|
|
|
#2: LOG_PASSWORD
|
|
|
|
#3: DRONE_BUILD_NUMBER
|
|
|
|
#4: TYPE (IT or Unit)
|
|
|
|
#5: DRONE_PULL_REQUEST
|
|
|
|
#6: GIT_USERNAME
|
|
|
|
#7: GIT_TOKEN
|
|
|
|
|
2018-11-01 12:59:08 +03:00
|
|
|
URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-integrationTests
|
2018-03-02 14:08:09 +03:00
|
|
|
ID=$3
|
|
|
|
USER=$1
|
|
|
|
PASS=$2
|
|
|
|
TYPE=$4
|
|
|
|
|
2019-06-06 00:54:07 +03:00
|
|
|
set -e
|
|
|
|
|
2018-03-02 14:08:09 +03:00
|
|
|
if [ $TYPE = "IT" ]; then
|
|
|
|
cd build/reports/androidTests/connected/flavors/GPLAY
|
2018-11-01 12:59:08 +03:00
|
|
|
else
|
2018-03-02 14:08:09 +03:00
|
|
|
cd build/reports/tests/testGplayDebugUnitTest
|
|
|
|
fi
|
|
|
|
|
|
|
|
find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$ID/$(echo {} | sed s#\./##) \;
|
|
|
|
find . -type f -exec curl -u $USER:$PASS -X PUT $URL/$ID/$(echo {} | sed s#\./##) --upload-file {} \;
|
|
|
|
|
2018-11-01 12:59:08 +03:00
|
|
|
echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$ID"
|
2019-02-07 09:28:28 +03:00
|
|
|
|
|
|
|
curl -u $6:$7 -X POST https://api.github.com/repos/nextcloud/android/issues/$5/comments -d "{ \"body\" : \"$TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$ID \" }"
|
|
|
|
|
2018-05-14 20:20:54 +03:00
|
|
|
exit 1
|