Skip to content

Instantly share code, notes, and snippets.

@h4
Created August 11, 2013 21:31
Show Gist options
  • Save h4/6206938 to your computer and use it in GitHub Desktop.
Save h4/6206938 to your computer and use it in GitHub Desktop.
Simple bottle app that works with github web hook.
# 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