From 3f834f5c3d5c167f5e63036d76a28bf8f8e6d9fe Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 12 Feb 2019 20:47:32 -0500 Subject: [PATCH] Add travis webhook example --- docs/Hook-Examples.md | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/Hook-Examples.md b/docs/Hook-Examples.md index b18abf7..f2cab8c 100644 --- a/docs/Hook-Examples.md +++ b/docs/Hook-Examples.md @@ -377,3 +377,50 @@ In order to leverage the Signing Key for addtional authentication/security you m ] ``` + +## Travis CI webhook +Travis sends webhooks as `payload=`, so the payload needs to be parsed as JSON. Here is an example to run on successful builds of the master branch. + +```json +[ + { + "id": "deploy", + "execute-command": "/root/my-server/deployment.sh", + "command-working-directory": "/root/my-server", + "parse-parameters-as-json": [ + { + "source": "payload", + "name": "payload" + } + ], + "trigger-rule": + { + "and": + [ + { + "match": + { + "type": "value", + "value": "passed", + "parameter": { + "name": "payload.state", + "source": "payload" + } + } + }, + { + "match": + { + "type": "value", + "value": "master", + "parameter": { + "name": "payload.branch", + "source": "payload" + } + } + } + ] + } + } +] +```