fix npm install exec

This commit is contained in:
Adrian Tiberius 2016-12-15 10:28:14 +02:00
parent 5c22ac61e8
commit 1c741273c4

View File

@ -1,19 +1,9 @@
<?php
ignore_user_abort(true);
set_time_limit(0);
$command = "cd /var/www/status-site && git reset --hard HEAD && git pull origin master && npm install && gulp build 2>&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");
}