uploadReport.sh 890 B

123456789101112131415161718192021222324252627282930
  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. if [ $TYPE = "IT" ]; then
  15. cd build/reports/androidTests/connected/flavors/GPLAY
  16. else
  17. cd build/reports/tests/testGplayDebugUnitTest
  18. fi
  19. find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$ID/$(echo {} | sed s#\./##) \;
  20. find . -type f -exec curl -u $USER:$PASS -X PUT $URL/$ID/$(echo {} | sed s#\./##) --upload-file {} \;
  21. echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$ID"
  22. 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 \" }"
  23. exit 1