diff --git a/upload-result.sh b/upload-result.sh new file mode 100755 index 0000000..4a7eb17 --- /dev/null +++ b/upload-result.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +i=$1 + +if [[ -z $AUTH_HEADER ]]; then + echo "Please provide \$AUTH_HEADER"; + exit; +fi + +if [[ -z $i ]]; then + echo "Please provide index of result to send" +fi + +echo "Fetching result $i..."; +curl "http://localhost:5002/results/$i/results.json" -f -o result.json || { + curl "http://localhost:5002/restart_test/$i" + exit; +} + +echo "Sending results $i..."; +curl 'https://lwc.las3.de/admin/insert-result.php' \ + -f -H "$AUTH_HEADER" \ + --data "$(cat result.json)" || exit +echo "Sent."; + +curl "http://localhost:5002/delete_test/$i"