trigger a git commit for static site generator

Justin Dorfman jdorfman at netdna.com
Wed Aug 8 22:44:25 UTC 2012


This *might *work (and can be dangerous IMO):

x="`tail -f /usr/local/nginx/logs/access.log |grep PUT |sed 's/["]//g' |awk
{'print $5'}`"; while x="PUT"; do git commit -m "Hello Igor"; done

Your logs would have to be formated like this:

8.8.8.8 foo.bar.netdna-cdn.com [08/Aug/2012:22:41:23 +0000] "PUT ...
4.2.2.2 bar.foo.netdna-cdn.com [08/Aug/2012:22:41:23 +0000] "PUT ...

Regards,

Justin Dorfman <http://www.twitter.com/jdorfman>

NetDNA <http://www.netdna.com>™
The Science of Acceleration™



On Wed, Aug 8, 2012 at 2:58 PM, klml <nginx-forum at nginx.us> wrote:

> I build a small static site generator: just PUT markdown from a textarea
> to a git versioned file and post-commit markdown.sh (and little bit
> templating) to html for nginx.
>
> The only thing I miss the commit triggerd by nginx after the PUT.
>
> I tried it with shell ect[^1] and even netcat ;) but nothing worked
> really nice.
>
> Is there an easy way to commit via nginx?
>
> thx
> klml
>
> [^1]: http://forum.nginx.org/read.php?2,181239
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,229477,229477#msg-229477
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120808/1be11395/attachment.html>


More information about the nginx mailing list