Golang Git update hook server?

blov · 2016-01-25 22:55:50 · 1207 次点击    
这是一个分享于 2016-01-25 22:55:50 的资源,其中的信息可能已经有所发展或是发生改变。

I've got a document root for a project controlled by git, and currently the git repo is just on the server. I'm looking to move the git repository onto github (or similar) and I think having a webserver up and listing for the update hook then updating content is probably the best way to go.

The webserver's written in Go, and there's no other dependencies on the VPS that I'm currently running this on, so I'd don't really want to add a bunch of cruft.

So, I'm thinking of writing a Go server to do exactly this - and probably just grabbing someone else's git library for the backend.

All of that in mind, I don't want to write this (small server) if someone already has. So.... Anyone know of a simple git update hook server written in Go?

Thanks :smile:


评论:

karnd01:

https://github.com/go-playground/webhooks here's one I wrote, is super simple to use and setup, works with GitHub and Bitbucket.

Hope it helps :)

mwholt:

So like what Caddy does with the git add-on? https://caddyserver.com/docs/git - with it I just git push to deploy my site. Is that what you meant? But you need git installed on the server...

jahayhurst:

Pretty much exactly what I was looking for - but without the git requirement.

Now I have to decide if I want to just install git, or write something myself :\ Still, this is almost exactly what I was hoping for - ty

captncraig:

Without installing git you could possibly use something based on libgit2. git2go is fairly good bindings,but getting it set up properly will definitely be trickier than installing git. caddy works great for me in these situations.

literallyelvis:

I wrote a small webserver that listens for a webhook, authenticates, and then executes some commands: https://github.com/LiterallyElvis/captain-hook

jahayhurst:

This is about 1/2 way to what I wanted - and the most promising so far. Thanks :-)


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1207 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传