Drone plugin for triggering webhook notifications
Go to file
Thomas Boerger 4ca75e7f05 Merge pull request #11 from drone-plugins/feature/fixes
Added back required env variable, fixed typo
2016-01-25 00:18:09 +01:00
.drone.sec Added back required env variable 2016-01-22 23:07:06 +01:00
.drone.yml Added back required env variable 2016-01-22 23:07:06 +01:00
.gitignore Extended gitignore 2015-12-10 10:09:39 +01:00
DOCS.md Restrucutred and extended documentation 2015-12-10 10:09:39 +01:00
Dockerfile Switched to 3.3 base image, documented docker make task 2016-01-01 12:47:20 +01:00
LICENSE Fixed license styling 2016-01-01 12:47:38 +01:00
MAINTAINERS Updated MAINTAINERS file [CI SKIP] 2015-12-09 14:19:07 -08:00
Makefile Unification: Drone config, Makefile, structure and badges 2016-01-21 16:21:36 +01:00
README.md Fixed typo 2016-01-22 23:06:47 +01:00
logo.svg initial support for webhooks 2015-11-03 11:31:25 -08:00
main.go Unification: Drone config, Makefile, structure and badges 2016-01-21 16:21:36 +01:00
types.go changing Urls to URLs 2016-01-08 12:27:49 -06:00

README.md

drone-webhook

Build Status Coverage Status

Drone plugin to send build status notifications via Webhook

Binary

Build the binary using make:

make deps build

Example

./drone-webhook <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "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"
    },
    "vargs": {
        "urls": [
            "https://your.webhook/..."
        ],
        "debug": true,
        "auth": {
            "username": "johnsmith",
            "password": "secretPass"
        },
        "method": "POST",
        "template": "{\"git_branch\": \"{{ .Build.Branch }}\"}",
        "content_type": "application/json"
    }
}
EOF

Docker

Build the container using make:

make deps docker

Example

docker run -i plugins/drone-webhook <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "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"
    },
    "vargs": {
        "urls": [
            "https://your.webhook/..."
        ],
        "debug": true,
        "auth": {
            "username": "johnsmith",
            "password": "secretPass"
        },
        "method": "POST",
        "template": "{\"git_branch\": \"{{ .Build.Branch }}\"}",
        "content_type": "application/json"
    }
}
EOF