-
-
Notifications
You must be signed in to change notification settings - Fork 188
Webhook template library
Beth Skurrie edited this page Jun 11, 2018
·
19 revisions
Please feel free add any that you think might be useful to others.
{
"events": [
{
"name": "contract_content_changed"
},
{
"name": "provider_verification_published"
}
],
"request": {
"method": "POST",
"url": "https://api.github.com/repos/<organization>/<project>/statuses/${pactbroker.consumerVersionNumber}",
"headers": {
"Content-Type": "application/json"
},
"body": {
"state": "${pactbroker.githubVerificationStatus}",
"description": "Pact Verification Tests",
"context": "${pactbroker.providerName} ${pactbroker.providerVersionTags}",
"target_url": "${pactbroker.verificationResultUrl}"
},
"username": "USERNAME",
"password": "PASSWORD"
}
}{
"events": [{
"name": "contract_content_changed"
}],
"request": {
"method": "POST",
"url": "https://api.travis-ci.org/repo/<organization>%2F<project>/requests",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Travis-API-Version": "3",
"Authorization": "token TOKEN"
},
"body": {
"request": {
"message": "Triggered by changed pact for ${pactbroker.consumerName} version ${pactbroker.consumerVersionNumber}",
"branch":"master"
}
}
}
}For more information on triggering Travis builds, see https://docs.travis-ci.com/user/triggering-builds
{
"request": {
"method": "POST",
"url": "http://master.ci.my.domain:8085/rest/api/latest/queue/SOME-PROJECT?os_authType=basic",
"username": "username",
"password": "password",
"headers": {
"Accept": "application/json"
}
}
}{
"request": {
"method": "POST",
"url": "https://hooks.slack.com/services/<webhook id>",
"body": {
"channel": "#<your-channel-here>",
"username": "webhookbot",
"text": "New version of pact created for ${pactbroker.consumerName}/${pactbroker.providerName}: ${pactbroker.pactUrl}",
"icon_emoji": ":ghost:"
}
}
}
{
"request": {
"method": "POST",
"url": "https://<instance>/DefaultCollection/<project>/_apis/build/builds?api-version=2.0",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "<authorization>"
},
"body": {
"definition": {
"id": <build-definition-id>
},
"sourceBranch": "refs/heads/master",
"parameters": "{\"pactUrl\":\"${pactbroker.pactUrl}\"}"
}
}
}