mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-17 11:00:09 +00:00
refactoring
This commit is contained in:
parent
6af1966ac7
commit
363a5359bd
2 changed files with 10 additions and 35 deletions
|
@ -1,39 +1,14 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "draos",
|
"id": "webhook",
|
||||||
"command": "dir",
|
"command": "/home/adnan/redeploy-go-webhook.sh",
|
||||||
"secret": "",
|
"cwd": "/home/adnan/go",
|
||||||
"trigger-rule": {
|
"trigger-rule":
|
||||||
"and": [
|
{
|
||||||
{
|
"match":
|
||||||
"match": {
|
{
|
||||||
"parameter": "commits.100.id",
|
"parameter": "ref",
|
||||||
"value": "20c16a7055dae65c69b9ca3f2e8cd1ac8fe9bbf2"
|
"value": "refs/heads/master"
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"match": {
|
|
||||||
"parameter": "ref",
|
|
||||||
"value": "refs/heads/master"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"match": {
|
|
||||||
"parameter": "repository.id",
|
|
||||||
"value": "17341098"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "something",
|
|
||||||
"command": "",
|
|
||||||
"cwd": ".",
|
|
||||||
"trigger-rule": {
|
|
||||||
"match": {
|
|
||||||
"parameter": "second",
|
|
||||||
"value": "2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ func hookHandler(req *http.Request, params martini.Params) string {
|
||||||
err := decoder.Decode(&p)
|
err := decoder.Decode(&p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l4g.Warn("Error occurred while trying to parse the payload as JSON")
|
l4g.Warn("Error occurred while trying to parse the payload as JSON: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue