123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- // require_once realpath(dirname(__FILE__)) . '/../common.php';
- // require_once FRAMEWORK_PATH . 'protected/bin/common_script.php';
- // if (!singleProcess(getCurrentCommand(), '/data/webapps/gitbook.duowan.com/duowan_wiki/index.pid')) {
- // exit("Sorry, this script file has already been running ...\n");
- // }
- // error_reporting(E_ERROR);
- $cmdType = $_GET["cmd_type"]);
- function gitPull()
- {
- shell_exec("cd /data/webapps/gitbook.ouj.com/web && git pull");
- }
- function gitbookBuild()
- {
- shell_exec("cd /data/webapps/gitbook.ouj.com/web && gitbook build");
- }
- function gitbookInstall()
- {
- shell_exec("cd /data/webapps/gitbook.ouj.com/web && gitbook install");
- }
- if ("pull_rebuild" === $cmdType) {
- gitPull();
- gitbookBuild();
- }
- if ("install" === $cmdType) {
- gitPull();
- gitbookInstall()
- gitbookBuild();
- }
- header("HTTP/1.1 200 OK");
- echo("hook finish");
|