在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
webhookit
1. 安装
支持 Python 2 / 3。安装之后,在系统中可以得到两个命令工具: 2. 使用运行 # webhookit --helpUsage: webhookit [OPTIONS]Options: -c, --config PATH The web hook configure file path. -p, --port INTEGER The listening port of HTTP server. --help Show this message and exit. 运行 运行 3. 一个示例下面是一个简单的例子,用来展示如何使用本工具: # 1. 安装 webhookitpip install webhookit# 2. 初始化一个配置模版webhookit_config > /home/hustcc/webhook-configs/config4hustcc.py# 3. 更新 config4hustcc.py 配置内容vim config4hustcc.py# 4. 运行 http serverwebhookit -c config4hustcc.py 然后在浏览器中打开
4. 配置文件说明# -*- coding: utf-8 -*-'''Created on Mar-03-17 15:14:34@author: hustcc/webhookit'''# This means:# When get a webhook request from `repo_name` on branch `branch_name`,# will exec SCRIPT on servers config in the array.WEBHOOKIT_CONFIGURE = { # a web hook request can trigger multiple servers. 'repo_name/branch_name': [{ # if exec shell on local server, keep empty. 'HOST': '', # will exec shell on which server. 'PORT': '', # ssh port, default is 22. 'USER': '', # linux user name 'PWD': '', # user password or private key. # The webhook shell script path. 'SCRIPT': '/home/hustcc/exec_hook_shell.sh' }, ...], ...} Python 变量名 每个 webhook 都用仓库的名字和分支名字 服务器可以是远程的服务器,也可以是本地机器,如果要触发本机的脚本运行,那么请保持 5. LicenseMIT@hustcc. |
请发表评论