webhook/test/hooks.json.tmpl
Adnan Hajdarevic cc0d9b2cba fix tests, return raw output, return 500 if the command did not execute properly - fixes #87
return raw stdout instead of json wrapped message - fixes #88
2016-09-29 19:57:06 +02:00

139 lines
2.8 KiB
Cheetah

[
{
"id": "github",
"execute-command": "{{ .Hookecho }}",
"command-working-directory": "/",
"include-command-output-in-response": true,
"pass-environment-to-command":
[
{
"source": "payload",
"name": "head_commit.timestamp"
}
],
"pass-arguments-to-command":
[
{
"source": "payload",
"name": "head_commit.id"
},
{
"source": "payload",
"name": "head_commit.author.email"
}
],
"trigger-rule":
{
"and":
[
{
"match":
{
"type": "payload-hash-sha1",
"secret": "mysecret",
"parameter":
{
"source": "header",
"name": "X-Hub-Signature"
}
}
},
{
"match":
{
"type": "value",
"value": "refs/heads/master",
"parameter":
{
"source": "payload",
"name": "ref"
}
}
}
]
}
},
{
"id": "bitbucket",
"execute-command": "{{ .Hookecho }}",
"command-working-directory": "/",
"include-command-output-in-response": false,
"response-message": "success",
"parse-parameters-as-json": [
{
"source": "payload",
"name": "payload"
}
],
"trigger-rule": {
"and": [
{
"match": {
"type": "value",
"parameter": {
"source": "payload",
"name": "payload.canon_url"
},
"value": "https://bitbucket.org"
}
},
{
"match": {
"type": "value",
"parameter": {
"source": "payload",
"name": "payload.repository.absolute_url"
},
"value": "/webhook/testing/"
}
},
{
"match": {
"type": "value",
"parameter": {
"source": "payload",
"name": "payload.commits.0.branch"
},
"value": "master"
}
}
]
}
},
{
"id": "gitlab",
"execute-command": "{{ .Hookecho }}",
"command-working-directory": "/",
"response-message": "success",
"include-command-output-in-response": true,
"pass-arguments-to-command":
[
{
"source": "payload",
"name": "commits.0.id"
},
{
"source": "payload",
"name": "user_name"
},
{
"source": "payload",
"name": "user_email"
}
],
"trigger-rule":
{
"match":
{
"type": "value",
"value": "refs/heads/master",
"parameter":
{
"source": "payload",
"name": "ref"
}
}
}
}
]