1 Star 1 Fork 1

李子 / webhook

forked from Rex / webhook 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Github/Bitbucket/Gitosc webhook tools

Qiniu Logo

基于 Github/Bitbucket/Gitosc webhook 做了个小工具。

它能够做什么?简单来说,它就是一个让 Github/Bitbucket/Gitosc repo 在某个分支发生 push 行为的时候,自动触发一段脚本。

用法

go run webhook.go xxx.conf

这样就启动 webhook 服务器了。其中 conf 文件格式如下:

{
    "bind": ":9876",
    "items": [
    {
        "repo": "https://github.com/qiniu/docs.qiniu.com",
        "branch": "master",
        "script": "update-qiniu-docs.sh"
    },
    {
        "repo": "https://bitbucket.org/Wuvist/angelbot/",
        "branch": "master",
        "script": "restart-angelbot.sh"
    },
    {
        "repo": "git@git.oschina.net:test/test.git",
        "branch": "master",
        "password": "123456",
        "script": "test.sh"
    }
]}

这个样例是真实的。它设置了 1 个 hook 脚本,在 https://github.com/qiniu/docs.qiniu.com 这个 repo 的 master 有变化时,自动执行 update-qiniu-docs.sh 脚本。

与 Github 关联

在你的 repo 首页(例如 https://github.com/qiniu/docs.qiniu.com ),点 Settings,再进入 Service Hooks,再进入 WebHook URLs,这里你就可以设置你的 WebHook URL 了,比如 http://example.com:9876/

配置好后,再确定 webhook 已经启动,你就可以尝试向 repo push 一些修改,看看能不能执行相应的脚本了。

空文件

简介

支持gitosc的webhook,forked from https://github.com/qiniu/webhook 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xmeter/webhook.git
git@gitee.com:xmeter/webhook.git
xmeter
webhook
webhook
master

搜索帮助