add deploy debug logs
This commit is contained in:
parent
9148196a6f
commit
1f0c95e40d
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue