drone-webhook/README.md

120 lines
2.9 KiB
Markdown
Raw Normal View History

2015-11-03 19:31:25 +00:00
# drone-webhook
2016-01-01 11:46:21 +00:00
[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-webhook/status.svg)](http://beta.drone.io/drone-plugins/drone-webhook)
[![Coverage Status](https://aircover.co/badges/drone-plugins/drone-webhook/coverage.svg)](https://aircover.co/drone-plugins/drone-webhook)
2016-01-01 11:46:21 +00:00
[![](https://badge.imagelayers.io/plugins/drone-webhook:latest.svg)](https://imagelayers.io/?images=plugins/drone-webhook:latest 'Get your own badge on imagelayers.io')
Drone plugin to send build status notifications via Webhook
2015-11-03 19:31:25 +00:00
## Binary
2015-11-03 19:31:25 +00:00
Build the binary using `make`:
```
make deps build
```
### Example
```sh
./drone-webhook <<EOF
2015-11-03 19:31:25 +00:00
{
"repo": {
"clone_url": "git://github.com/drone/drone",
"owner": "drone",
2016-01-22 22:06:47 +00:00
"name": "drone",
"full_name": "drone/drone"
},
"system": {
"link_url": "https://beta.drone.io"
2015-11-03 19:31:25 +00:00
},
"build": {
2015-11-03 19:31:25 +00:00
"number": 22,
"status": "success",
"started_at": 1421029603,
"finished_at": 1421029813,
"message": "Update the Readme",
"author": "johnsmith",
"author_email": "john.smith@gmail.com"
"event": "push",
"branch": "master",
"commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
"ref": "refs/heads/master"
},
"workspace": {
"root": "/drone/src",
"path": "/drone/src/github.com/drone/drone"
2015-11-03 19:31:25 +00:00
},
"vargs": {
"urls": [
"https://your.webhook/..."
],
"debug": true,
"auth": {
"username": "johnsmith",
"password": "secretPass"
},
"method": "POST",
"template": "{\"git_branch\": \"{{ .Build.Branch }}\"}",
"content_type": "application/json"
2015-11-03 19:31:25 +00:00
}
}
EOF
```
## Docker
Build the container using `make`:
2015-11-03 19:31:25 +00:00
```
make deps docker
2015-11-03 19:31:25 +00:00
```
### Example
2015-11-03 19:31:25 +00:00
```sh
docker run -i plugins/drone-webhook <<EOF
{
"repo": {
"clone_url": "git://github.com/drone/drone",
"owner": "drone",
2016-01-22 22:06:47 +00:00
"name": "drone",
"full_name": "drone/drone"
},
"system": {
"link_url": "https://beta.drone.io"
2015-11-03 19:31:25 +00:00
},
"build": {
2015-11-03 19:31:25 +00:00
"number": 22,
"status": "success",
"started_at": 1421029603,
"finished_at": 1421029813,
"message": "Update the Readme",
"author": "johnsmith",
"author_email": "john.smith@gmail.com"
"event": "push",
"branch": "master",
"commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
"ref": "refs/heads/master"
},
"workspace": {
"root": "/drone/src",
"path": "/drone/src/github.com/drone/drone"
2015-11-03 19:31:25 +00:00
},
"vargs": {
"urls": [
"https://your.webhook/..."
],
"debug": true,
"auth": {
"username": "johnsmith",
"password": "secretPass"
},
"method": "POST",
"template": "{\"git_branch\": \"{{ .Build.Branch }}\"}",
"content_type": "application/json"
2015-11-03 19:31:25 +00:00
}
}
EOF
```