Webhook triggers allow you to trigger a new build by sending a request to the {product-title} API endpoint. You can define these triggers using GitHub, GitLab, Bitbucket, or Generic webhooks.
Currently, {product-title} webhooks only support the analogous versions of the push event for each of the Git-based source code management systems (SCMs). All other event types are ignored.
When the push events are processed, the {product-title} master host confirms if
the branch reference inside the event matches the branch reference in the
corresponding BuildConfig
. If so, it then checks out the exact commit
reference noted in the webhook event on the {product-title} build. If they do
not match, no build is triggered.
Note
|
|
For all webhooks, you must define a Secret
with a key named WebHookSecretKey
and the value being the value to be supplied when invoking the webhook. The
webhook definition must then reference the secret. The secret ensures the
uniqueness of the URL, preventing others from triggering the build. The value
of the key will be compared to the secret provided during the webhook
invocation.
For example here is a GitHub webhook with a reference
to a secret named mysecret
:
type: "GitHub"
github:
secretReference:
name: "mysecret"
The secret is then defined as follows. Note that the value of the secret is
base64 encoded as is required for any data
field of a Secret
object.
- kind: Secret
apiVersion: v1
metadata:
name: mysecret
creationTimestamp:
data:
WebHookSecretKey: c2VjcmV0dmFsdWUx