diff --git a/src/post-receive.php b/src/post-receive.php index ec2e04a..45d7d19 100644 --- a/src/post-receive.php +++ b/src/post-receive.php @@ -1,19 +1,9 @@ &1"; // TODO check against ip or secret hash -$log_file = "/var/www/status-site/build.log"; if ( $_SERVER['HTTP_X_GITHUB_EVENT'] == 'push' ) { - - if( ($fp = popen($command, "r")) ) { - //while( !feof($fp) ){ - // $result = fread($fp, 1024); - file_put_contents($log_file, $fp, FILE_APPEND); - //echo $result; - //flush(); - //} - fclose($fp); - } + shell_exec("sudo /var/www/status-site/deploy.sh"); + echo file_get_contents("/var/www/status-site/build.log"); }