All Projects → HavenShen → gohook

HavenShen / gohook

Licence: other
【Souvenir】Python 使用 Tornado 框架实现 WebHook 自动部署 Git 项目。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to gohook

Webhookit
Simple git webhook cli tool for automation tasks, bind git webhook to action.
Stars: ✭ 177 (+240.38%)
Mutual labels:  webhook, coding, tornado
django-rok
Public url for your local django web server
Stars: ✭ 19 (-63.46%)
Mutual labels:  webhook
a80
Intel 8080/Zilog Z80 assembler written in D.
Stars: ✭ 23 (-55.77%)
Mutual labels:  coding
YappyGitHub
A github monitor bot for Discord
Stars: ✭ 64 (+23.08%)
Mutual labels:  webhook
mattermost-bitbucket-bridge
Flask application that serves as a bridge between Bitbucket and Mattermost.
Stars: ✭ 18 (-65.38%)
Mutual labels:  webhook
tornado-aws
A low-level Amazon Web Services API client for Tornado
Stars: ✭ 12 (-76.92%)
Mutual labels:  tornado
dialogflow-webhook-response-libary-in-python
This library simplifies the JSON response building in Python for Dialogflow.
Stars: ✭ 56 (+7.69%)
Mutual labels:  webhook
nats.py2
A Tornado based Python 2 client for NATS
Stars: ✭ 62 (+19.23%)
Mutual labels:  tornado
programmers
programmers를 이용한 코딩테스트 공부
Stars: ✭ 42 (-19.23%)
Mutual labels:  coding
froggit-go
Froggit-Go is a universal Go library, allowing to perform actions on VCS providers.
Stars: ✭ 19 (-63.46%)
Mutual labels:  webhook
CTFtime-Discord-hooks
A script that will send the upcoming CTFs to given discord webhook
Stars: ✭ 18 (-65.38%)
Mutual labels:  webhook
django-hurricane
Hurricane is an initiative to fit Django perfectly with Kubernetes.
Stars: ✭ 53 (+1.92%)
Mutual labels:  tornado
discord-twitter-webhooks
🤖 Stream tweets to Discord
Stars: ✭ 47 (-9.62%)
Mutual labels:  webhook
DSA-guide
Trying to cover important DSA
Stars: ✭ 51 (-1.92%)
Mutual labels:  coding
torinotech.github.io
torinotech.github.io
Stars: ✭ 16 (-69.23%)
Mutual labels:  coding
plaxt
Webhooks based Trakt.tv scrobbling for Plex
Stars: ✭ 20 (-61.54%)
Mutual labels:  webhook
Competitive-Programming-Algorithms
The purpose of this repository is to get all the Algorithms required for Competitive Programming at one place. This will be very helpful. Also one can contribute to this repository and learn something from this.
Stars: ✭ 21 (-59.62%)
Mutual labels:  coding
gogs-webhook-plugin
Jenkins Gogs Webhook
Stars: ✭ 76 (+46.15%)
Mutual labels:  webhook
CodeForces
Python solutions to CodeForces problems
Stars: ✭ 48 (-7.69%)
Mutual labels:  coding
hook-slinger
A generic service to send, retry, and manage webhooks.
Stars: ✭ 88 (+69.23%)
Mutual labels:  webhook

gohook

Python 使用 Tornado 框架实现 WebHook 自动部署 Git 项目

为了方便开发测试或项目部署至服务器不那么繁琐,搞一个自动部署的小轮子也是必要的。

小轮子需要涉及到 Coding 项目托管平台(也可以用 Github 平台),Linux服务器的Nginx、Python( Tornado框架 )。

同时配置项目托管平台的个人私钥或项目公钥,保证 git pull 能直接拉取。

安装

1.下载或克隆此项目

git clone [email protected]:HavenShen/gohook.git

2.部署代码的服务器必须安装 Python 的 Tornado框架

pip install tornado
#
easy_instal tornado

修改配置

1.修改 main.pyfile_path 变量路径

#希望自动部署项目路径
file_path = '/home/wwwroot/xxx'

2.配置 Nginx 的conf文件

# http 节点下增加
upstream frontends{
		server 127.0.0.1:8765;
	}
	
#增加 server 配置
server {
    listen 80;

    server_name xxx.xxx.com; #你的域名

    location / {
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_pass http://frontends;
    }
}

在此可以重启下 Nginx

启动

1.运行tornado框架开启后台进程运行

#下面路径修改成你自己gohook存放目录文件夹用户组必须跟nginx一致
setsid python /home/wwwroot/gohook/main.py &

配置 Coding 项目 WebHook

1.url 填你的域名 http://xxx.xxx.com/gohook

2.tokengohook

测试

1.本地于服务器自动部署的git项目中使用 git 提交更新一下代码

touch test.md
git add .
git commit -m "test gohook"
git push -u origin master 

2.查看服务器上自动部署的git项目中是否存在 test.md

done.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].