uploadReport.sh 898 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. #1: LOG_USERNAME
  3. #2: LOG_PASSWORD
  4. #3: DRONE_BUILD_NUMBER
  5. #4: TYPE (IT or Unit)
  6. #5: DRONE_PULL_REQUEST
  7. #6: GIT_USERNAME
  8. #7: GIT_TOKEN
  9. URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-integrationTests
  10. ID=$3
  11. USER=$1
  12. PASS=$2
  13. TYPE=$4
  14. set -e
  15. if [ $TYPE = "IT" ]; then
  16. cd build/reports/androidTests/connected/flavors/GPLAY
  17. else
  18. cd build/reports/tests/testGplayDebugUnitTest
  19. fi
  20. find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$ID/$(echo {} | sed s#\./##) \;
  21. find . -type f -exec curl -u $USER:$PASS -X PUT $URL/$ID/$(echo {} | sed s#\./##) --upload-file {} \;
  22. echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$ID"
  23. 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 \" }"
  24. exit 1