自动部署 webhook

2016-05-25 0 条评论 182 次阅读 0 人点赞

在github中webhook中添加自己的回调接口然后处理github发过来的请求python代码如下:

import web
from subprocess import call
path = '/home/wwwroot/default/testsmirk.github.io'
git_path = 'https://github.com/TestSmirk/testsmirk.github.io.git'
urls = (
    '/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
    def POST(self, name):
        call(['cd "' + path + '" && git pull '+git_path], shell=True)
if __name__ == "__main__":
    app.run()

TestSmirk

这个人太懒什么东西都没留下

文章评论(0)