Setting Up Builder Webhooks
Page last updated:
This topic describes how to set up builder webhooks for Pivotal Build Service.
Overview
By default, Build Service polls its image registry to know when buildpacks have been updated for a builder image. This allows Build Service to rebuild your images when updated buildpacks are available.
You may want to use webhooks instead of relying on the default polling behavior. Using webhooks avoids the polling delay when a builder image has been updated with new buildpacks.
Supported Image Registries
You can set up builder webhooks for any of the image registries in this section.
Artifactory
To set up builder webhooks for an Artifactory repository:
Note: The Artifactory repository must be the same one you used when you ran Duffle during the Build Service installation.
Follow the installation procedure in the Artifactory Webhook Plugin repository on GitHub.
Configure the plugin to send
docker.tagCreated
events to theBUILD-SERVICE-API/v1/artifactory/webhook
endpoint, as in this example configuration:{ "webhooks": { "ci": { "url": "BUILD-SERVICE-API/v1/artifactory/webhook", "events": [ "docker.tagCreated" ], "repositories": ["ARTIFACTORY-REPOSITORY"], "format": "default" }, } }
Where:
BUILD-SERVICE-API
is the URL of your API.ARTIFACTORY-REPOSITORY
is your Artifactory repository.
Docker Registry Notifications
To set up notifications for a Docker registry:
Note: The Docker registry must be the same one you used when you ran duffle relocate
during the Build Service installation.
Follow the configuration procedure in Work with notifications in the Docker documentation.
Add a notification endpoint to your registry configuration, as in the example below:
notifications: endpoints: - name: build-service url: BUILD-SERVICE-API/v1/docker/notification timeout: 5s threshold: 5 backoff: 10s
Where
BUILD-SERVICE-API
is the URL of your API.
Docker Hub
To set up builder webhooks for Docker Hub:
Follow the configuration procedure in Docker Hub Webhooks in the Docker documenation to add a webhook for the relocated builder image.
- You can find this image by running:
kubectl get builder build-service-builder -n build-service-builds -o jsonpath='{.spec.image}'
Where
BUILD-SERVICE-API
is the URL of your API.
- The webhook should be configured to use the
BUILD-SERVICE-API/v1/docker/webhook
endpoint.Warning: Docker Hub requires Build Service to use a CA-signed certificate.