ansible/playbooks/apps/templates/bin/healthcheck.j2

12 lines
334 B
Text
Raw Normal View History

2024-10-11 16:42:01 +02:00
#!/bin/bash
set -uo pipefail
RID=`uuidgen`
BASE_URL="https://hc-ping.com/{{ healthcheck_webhook_token }}/$1"
START_URL="$BASE_URL/start?rid=$RID"
shift
curl -A "ubuntu-vm" -fsS --retry 5 -o /dev/null $START_URL
logs=$($@ 2>&1)
status=$?
curl -A "ubuntu-vm" -fsS --retry 5 --data-raw "$logs" -o /dev/null "$BASE_URL/$status?rid=$RID"