Welcome! Log In Create A New Profile

Advanced

Re: trigger a git commit for static site generator

Justin Dorfman
August 08, 2012 06:46PM
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@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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

trigger a git commit for static site generator

klml August 08, 2012 05:58PM

Re: trigger a git commit for static site generator

Justin Dorfman August 08, 2012 06:46PM

Re: trigger a git commit for static site generator

klml August 09, 2012 06:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 227
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready