lms/scripts/test_dokploy_webhook.sh

20 lines
599 B
Bash

#!/usr/bin/env bash
# Test script: send a sample push webhook to Dokploy
set -euo pipefail
WEBHOOK_URL=${WEBHOOK_URL:-"https://system.cloudarix.de/api/deploy/compose/JXSdfeHdc6wBKUEiJrX_9"}
REPO=${REPO:-"org/repo"}
COMMIT=${COMMIT:-"test-commit-sha"}
payload=$(cat <<JSON
{
"ref": "refs/heads/main",
"commits": [ { "id": "${COMMIT}", "message": "test webhook" } ],
"repository": { "full_name": "${REPO}", "clone_url": "git@gitea.example.com:${REPO}.git" }
}
JSON
)
echo "Posting test webhook to $WEBHOOK_URL"
curl -v -X POST "$WEBHOOK_URL" -H "Content-Type: application/json" -d "$payload"