uploadScreenshotSummary.sh 783 B

123456789101112131415161718192021
  1. #!/bin/bash -x
  2. # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
  3. # SPDX-FileCopyrightText: 2021 Tobias Kaminsky <tobias@kaminsky.me>
  4. # SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
  5. #1: LOG_USERNAME
  6. #2: LOG_PASSWORD
  7. DAV_URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-screenshot-summary/
  8. PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-screenshot-summary
  9. USER=$1
  10. PASS=$2
  11. date=$(date +%F)
  12. echo "Uploaded screenshot summary to $PUBLIC_URL/$date/summary.html"
  13. cd app/build/screenshotSummary
  14. find . -type d -exec curl > /dev/null 2>&1 -u $USER:$PASS -X MKCOL $DAV_URL/$date/$(echo {} | sed s#\./##) \;
  15. find . -type f -exec curl > /dev/null 2>&1 -u $USER:$PASS -X PUT $DAV_URL/$date/$(echo {} | sed s#\./##) --upload-file {} \;