#!/usr/bin/python3
import git
from aiohttp import web
async def hello(request):
return web.Response(text="Hello, world")
async def pull(request):
repo_path = '/opt/***'
repo = git.Repo(repo_path)
print(repo.git.pull('origin', 'dev'))
return web.Response(text='OK')
app = web.Application()
app.add_routes([web.get('/', hello)])
app.add_routes([web.get('/push', pull)])
app.add_routes([
web.post('/push', pull)])
web.run_app(app)