-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.sh
More file actions
21 lines (16 loc) Β· 967 Bytes
/
run.sh
File metadata and controls
21 lines (16 loc) Β· 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
trap '>&2 echo ERROR: Command on line $LINENO failed: $(tail -n+$LINENO $0 | head -n1) && exit 1' ERR
echo "π· starting job"
echo
echo "π‘ printing env"
env
echo "π΄ sleep 10s"
sleep 10
echo "π calling report callback: ${CALLBACK_SERVICE_RESULT_URL}"
echo "- send file"
curl --silent --show-error -X POST -H 'Content-Disposition: attachment;filename="test.txt"' --data-binary 'This is an uploaded file' "${CALLBACK_SERVICE_FILE_URL}"
echo "- trigger event"
curl --silent --show-error -X POST -H "Content-Type: application/json; charset=utf-8" --data-binary '{"warning": false,"reason": "TestReason","message": "test message with %s","args": ["arg"]}' "${CALLBACK_SERVICE_EVENT_URL}"
echo "- send metric"
curl --silent --show-error -X POST -H "Content-Type: application/json; charset=utf-8" --data-binary '{ "my_metric": [{ "value": 1.0, "labels": { "label_a": "AAA", "label_b": "BBB" }}] }' "${CALLBACK_SERVICE_RESULT_URL}"
echo "π done"