Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

try to use a curl header file to stop jenkins madness #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 7 additions & 39 deletions upload.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
curl --version
failed=false
logfile=/tmp/logfile.$$
curllog=/tmp/curllog.$$
Expand Down Expand Up @@ -49,24 +50,13 @@ EOF
echo "Uploading $file"

url="https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots/$a-${panel}"
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
-X DELETE > $curllog
curl "$url" -s -v -H @curl_headers.txt -X DELETE > $curllog
logDelete $url

sleep 5

url='https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots'
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
--data-binary @${file} \
--compressed > $curllog || failed=true
curl "$url" -s -v -H @curl_headers.txt --data-binary @${file} --compressed > $curllog || failed=true
logCreate $url
else
echo "ERROR: $file missing"
Expand All @@ -78,47 +68,25 @@ done
echo "Uploading simple-performance-cluster"

url='https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots/simple-performance-cluster'
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
-X DELETE > $curllog
curl "$url" -s -v -H @curl_headers.txt -X DELETE > $curllog
logDelete $url

sleep 5

url='https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots'
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
--data-binary @cluster.json \
--compressed > $curllog || failed=true
curl $url -s -v -H @curl_headers.txt --data-binary @cluster.json --compressed > $curllog || failed=true
logCreate $url

echo "Uploading simple-performance-singleserver-cluster-devel"

url='https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots/simple-performance-singleserver-cluster-devel'
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
-X DELETE > $curllog
curl "$url" -s -v -H @curl_headers.txt -X DELETE > $curllog
logDelete $url

sleep 5

url='https://g-dc685c4b12.grafana-workspace.eu-central-1.amazonaws.com/api/snapshots'
curl $url -s -k -v \
-H 'accept: application/json, text/plain, */*' \
-H "x-grafana-org-id: ${GRAFANA_ORG_ID}" \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${GRAFANA_API_KEY}" \
--data-binary @single-cluster.json \
--compressed > $curllog || failed=true
curl "$url" -s -v -H @curl_headers.txt --data-binary @single-cluster.json --compressed > $curllog || failed=true
logCreate $url

rm -f $curllog
Expand Down