Sign inSign up

ugrawert/gocd-webhooks

By ugrawert

•Updated about 7 years ago

Webhooks for GoCD

Image
0

1.0K

ugrawert/gocd-webhooks repository overview

⁠Webhooks for GoCD

This docker image hosts a webhook⁠ receiver for GoCD.

Currently onyl one webhook for Gitea is configured. But any other Git server can be added easily to hooks.json. See documentation⁠ on how to define hooks.

For GoCD API authorisation an admin-user's access token is required. See documentation⁠. The GoCD material URL has to match the URL sent with the webhook to shedule the material for update.

  • For Gitea the URL is in the json payload at repository.clone_url

⁠Prerequisites

  • Docker
  • GoCD server >= v19.6.0
  • Gitea server >= 1.9

⁠Run

docker run \
 --name webhook \
 -p 9000:9000 \
 -e SECRET="WEBHOOK_SECRET" \
 -e GO_API_TOKEN="GO_ADMIN_USER_TOKEN" \
 -e GO_SERVER_URL="http://gocd-server:8153" \
 ugrawert/gocd-webhooks

To serve secure content using HTTPS, you need to provide the following parameters:

docker run \
 --name webhook \
 -p 9000:9000 \
 -e SECRET="WEBHOOK_SECRET" \
 -e GO_API_TOKEN="GO_ADMIN_USER_TOKEN" \
 -e GO_SERVER_URL="http://gocd-server:8153" \
 -secure \
 -cert /path/to/cert.pem \
 -key /path/to/key.pem \
 ugrawert/gocd-webhooks

⁠Configuration

⁠Gitea

Either configure a global webhook via Site Administration -> Default Webhooks or configure webhooks per repository Settings -> Webhooks.

ParameterValue
Target URLhttp://webhook:9000/hooks/gitea⁠
HTTP MethodPOST
Content Typeapplication/json
SecretWEBHOOK_SECRET

⁠Troubleshooting

⁠Enable verbose mode
docker run \
 --name webhook \
 -p 9000:9000 \
 -e SECRET="WEBHOOK_SECRET" \
 -e GO_API_TOKEN="GO_ADMIN_USER_TOKEN" \
 -e GO_SERVER_URL="http://gocd-server:8153" \
 ugrawert/gocd-webhooks -template -hooks=/opt/webhook/hooks.json -verbose

Tag summary

Content type

Image

Digest

Size

10.1 MB

Last updated

about 7 years ago

docker pull ugrawert/gocd-webhooks