# oschinaGitListener **Repository Path**: steven0lisa/oschinaGitListener ## Basic Information - **Project Name**: oschinaGitListener - **Description**: oschina的hook功能的go版 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2014-11-10 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README oschinaGitListener ====================== Version 0.0.4 给oschina 的git的hook服务写了个小工具,主要用来在项目收到push以后自动在服务器上进行更新,执行相关命令等. * 使用方式 `go build && exec` * 启动参数 -c 设定配置文件的路径 * 配置文件 配置文件采用toml格式编写 (toml[Spec](https://github.com/toml-lang/toml)) 默认是当前目录下的config.toml文件 sample: [server] addr = "0.0.0.0:8088" #监听端口 [log.console] use = true #是否在屏幕上输出日志 logLevel = 0 #日志等级 0~4 [log.file] use = true #是否在文件中输出日志 name = "log.log" #日志文件名 logLevel = 0 #日志等级 0~4 [supervisor.helloworld] #要监控的项目名 这里是helloworld, 则本程序会将 "/helloworld" 作为此项目接受push信息的url [[supervisor.helloworld.commands]] #给helloworld 添加一个git响应 name = "gitpull" workDir = "/home/test/proj1" #设定命令的工作目录 cmd = "git pull origin master" #要执行的命令 outlog = "/home/test/proj1/gitoutlog.log" #输出日志 pushData = false #如果想要将push过来的data pipe给调用的程序,则为true [[supervisor.helloworld.commands]] #添加一个echo响应 name = "myecho1" workDir = "/home/test/proj1" cmd = "echo -n" outlog = "/home/test/proj1/gitoutlog.log" pushData = true 请看example_comfig.toml * 欢迎pull request