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
评论:
karnd01:
mwholt: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 :)
jahayhurst: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...
captncraig: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
literallyelvis: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.
jahayhurst:I wrote a small webserver that listens for a webhook, authenticates, and then executes some commands: https://github.com/LiterallyElvis/captain-hook
This is about 1/2 way to what I wanted - and the most promising so far. Thanks :-)
