Created
August 11, 2013 21:31
-
-
Save h4/6206938 to your computer and use it in GitHub Desktop.
Simple bottle app that works with github web hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import json | |
from bottle import route, run, request, debug, default_app | |
from git import Repo | |
repo = Repo("/var/www/lookido.ru/promo/htdocs") | |
origin = repo.remotes.origin | |
@route("/", method="POST") | |
def index(): | |
data = json.loads(request.POST['payload']) | |
ref = data['ref'] | |
if ref == "refs/heads/master": | |
origin.pull() | |
return "done" | |
app = default_app() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment