add deploy debug logs

This commit is contained in:
Adrian Tiberius 2016-09-18 09:37:27 +03:00
parent 9148196a6f
commit 1f0c95e40d
1 changed files with 5 additions and 2 deletions

View File

@ -2,13 +2,16 @@
$command = "cd /var/www/status-site && git reset --hard HEAD && git pull origin master && gulp build";
// TODO check against ip or secret hash
$log_file = "/var/www/status-site/build.log";
file_put_contents($log_file, var_export($_SERVER, true), FILE_APPEND);
$content = file_get_contents("php://input");
file_put_contents($log_file, var_export($content, true), FILE_APPEND);
if ( $_SERVER['X-GitHub-Event'] == 'push' ) {
if( ($fp = popen($command, "r")) ) {
while( !feof($fp) ){
$result = fread($fp, 1024);
file_put_contents("/var/www/status-site/build.log", $result, FILE_APPEND);
file_put_contents($log_file, $result, FILE_APPEND);
echo $result;
flush();
}