Golang Git update hook server?

blov · · 1066 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve got a document root for a project controlled by git, and currently the git repo is just on the server. I&#39;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.</p> <p>The webserver&#39;s written in Go, and there&#39;s no other dependencies on the VPS that I&#39;m currently running this on, so I&#39;d don&#39;t really want to add a bunch of cruft.</p> <p>So, I&#39;m thinking of writing a Go server to do exactly this - and <a href="https://github.com/gogits/git" rel="nofollow">probably</a> <a href="https://github.com/speedata/gogit" rel="nofollow">just</a> grabbing someone else&#39;s git library for the backend.</p> <p>All of that in mind, I don&#39;t want to write this (small server) if someone already has. So.... Anyone know of a simple git update hook server written in Go?</p> <p>Thanks :-)</p> <hr/>**评论:**<br/><br/>karnd01: <pre><p><a href="https://github.com/go-playground/webhooks" rel="nofollow">https://github.com/go-playground/webhooks</a> here&#39;s one I wrote, is super simple to use and setup, works with GitHub and Bitbucket.</p> <p>Hope it helps :)</p></pre>mwholt: <pre><p>So like what Caddy does with the git add-on? <a href="https://caddyserver.com/docs/git" rel="nofollow">https://caddyserver.com/docs/git</a> - with it I just <code>git push</code> to deploy my site. Is that what you meant? But you need git installed on the server...</p></pre>jahayhurst: <pre><p>Pretty much exactly what I was looking for - but without the git requirement.</p> <p>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</p></pre>captncraig: <pre><p>Without installing git you could possibly use something based on libgit2. <a href="https://github.com/libgit2/git2go" rel="nofollow">git2go</a> 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.</p></pre>literallyelvis: <pre><p>I wrote a small webserver that listens for a webhook, authenticates, and then executes some commands: <a href="https://github.com/LiterallyElvis/captain-hook" rel="nofollow">https://github.com/LiterallyElvis/captain-hook</a></p></pre>jahayhurst: <pre><p>This is about 1/2 way to what I wanted - and the most promising so far. Thanks :-)</p></pre>

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

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