feat(api): add Woodpecker CI webhook notifications
This commit is contained in:
@@ -271,6 +271,26 @@ steps:
|
||||
depends_on:
|
||||
- docker-build-orchestrator
|
||||
|
||||
notify-webhook:
|
||||
image: curlimages/curl:8.6.0
|
||||
environment:
|
||||
MOSAIC_WEBHOOK_URL:
|
||||
from_secret: mosaic_webhook_url
|
||||
WOODPECKER_WEBHOOK_SECRET:
|
||||
from_secret: woodpecker_webhook_secret
|
||||
commands:
|
||||
- |
|
||||
BODY="{\"branch\":\"${CI_COMMIT_BRANCH}\",\"status\":\"${CI_PIPELINE_STATUS}\",\"buildUrl\":\"${CI_PIPELINE_LINK}\",\"repo\":\"${CI_REPO}\"}"
|
||||
SIG=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$WOODPECKER_WEBHOOK_SECRET" | awk '{print $2}')
|
||||
curl -s -o /dev/null -w "%{http_code}" -X POST "${MOSAIC_WEBHOOK_URL}/api/webhooks/woodpecker" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Woodpecker-Signature: ${SIG}" \
|
||||
-d "$BODY" || true
|
||||
when:
|
||||
- status: [success, failure]
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
security-trivy-web:
|
||||
image: aquasec/trivy:latest
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user