github-webhook工具实现github自动构建

栏目: IT技术 · 发布时间: 5年前

内容简介:当本地源码:

原理

当本地 git push origin master 向Github远程仓库提交代码时,可以通过配置github自带webhook向服务器发送请求,利用github-webhook工具在服务器端接到请求后,调用自定义 shell 脚本来实现自动构建

github-webhook工具实现github自动构建

github-webhook 文档

使用github-webhook

源码: https://github.com/yezihack/github-webhook 别忘记点个小星星哦.

1. 下载github-webhook工具

https://github.com/yezihack/github-webhook/releases

github release下载太慢, 试试这个

wget http://img.sgfoot.com/github-webhook1.4.1.linux-amd64.tar.gz

2. 运行github-webhook

安装

tar -zxvf github-webhook1.4.1.linux-amd64.tar.gz
cp github-webhook /usr/bin/
chmod u+x /usr/bin/github-webhook

运行

-b
-s
# 非后台运行
github-webhook -b [shell脚本路径] -s [github webhook设置的密码]

# 后台运行
nohup github-webhook -b [shell脚本路径] -s [github webhook设置的密码] & 

# 定向日志输出
`nohup github-webhook -b ~/sh/hugo2www.sh -s qweqwe >> ~/logs/webhook.log 2>&1 &`

配置github webhook

github-webhook -s

github-webhook工具实现github自动构建

github-webhook工具实现github自动构建

github-webhook工具实现github自动构建

测试

git push后, 你就可以看到github推送的信息

git push origin master

以上所述就是小编给大家介绍的《github-webhook工具实现github自动构建》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Pro Git

Pro Git

Scott Chacon / Apress / 2009-8-27 / USD 34.99

Git is the version control system developed by Linus Torvalds for Linux kernel development. It took the open source world by storm since its inception in 2005, and is used by small development shops a......一起来看看 《Pro Git》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具