-
-
Save litaonet/bc6f657e7bc53755316e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $fs = fopen('./cycle_hook.log', 'a'); | |
| $client_ip = $_SERVER['REMOTE_ADDR']; | |
| fwrite($fs, 'Request on ['.date("Y-m-d H:i:s").'] from ['.$client_ip.']'.PHP_EOL); | |
| $json = file_get_contents('php://input'); | |
| $data = json_decode($json, true); | |
| fwrite($fs, 'Data: '.print_r($data, true).PHP_EOL); | |
| fwrite($fs, '======================================================================='.PHP_EOL); | |
| $fs and fclose($fs); | |
| // 執行上面所述的 update.sh | |
| echo "<pre>"; | |
| echo shell_exec("/bin/sh ". __DIR__ . '/update.sh'); | |
| echo '</pre>'; | |
| /* | |
| update.sh | |
| #!/bin/bash | |
| cd /home/work/source/git/vsfinance_cycle/ui/ | |
| /home/work/local/git/bin/git remote update -p | |
| /home/work/local/git/bin/git checkout -f develop | |
| /home/work/local/git/bin/git pull | |
| cd /home/work/source/git/vsfinance_cycle/fe/ | |
| /home/work/local/git/bin/git remote update -p | |
| /home/work/local/git/bin/git checkout -f dev | |
| /home/work/local/git/bin/git pull | |
| cd /home/work/source/git/vsfinance_cycle/skeleton/ | |
| /home/work/local/git/bin/git remote update -p | |
| /home/work/local/git/bin/git checkout -f master | |
| /home/work/local/git/bin/git pull | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment