From dbbd736bac34cf46479fda84bb61a1514d318b42 Mon Sep 17 00:00:00 2001 From: Enrico Pozzobon Date: Tue, 4 Aug 2020 13:27:32 +0200 Subject: [PATCH] upload script --- upload-result.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 upload-result.sh 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" -- libgit2 0.26.0