Skip to content

Commit 0aa7395

Browse files
authored
Merge pull request #304 from johnpmitsch/travis
Add travis CI webhook example
2 parents 5bca86c + 3f834f5 commit 0aa7395

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/Hook-Examples.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,50 @@ In order to leverage the Signing Key for addtional authentication/security you m
377377
]
378378

379379
```
380+
381+
## Travis CI webhook
382+
Travis sends webhooks as `payload=<JSON_STRING>`, so the payload needs to be parsed as JSON. Here is an example to run on successful builds of the master branch.
383+
384+
```json
385+
[
386+
{
387+
"id": "deploy",
388+
"execute-command": "/root/my-server/deployment.sh",
389+
"command-working-directory": "/root/my-server",
390+
"parse-parameters-as-json": [
391+
{
392+
"source": "payload",
393+
"name": "payload"
394+
}
395+
],
396+
"trigger-rule":
397+
{
398+
"and":
399+
[
400+
{
401+
"match":
402+
{
403+
"type": "value",
404+
"value": "passed",
405+
"parameter": {
406+
"name": "payload.state",
407+
"source": "payload"
408+
}
409+
}
410+
},
411+
{
412+
"match":
413+
{
414+
"type": "value",
415+
"value": "master",
416+
"parameter": {
417+
"name": "payload.branch",
418+
"source": "payload"
419+
}
420+
}
421+
}
422+
]
423+
}
424+
}
425+
]
426+
```

0 commit comments

Comments
 (0)