|
|
|
@ -1,22 +1,18 @@
|
|
|
|
|
<?php
|
|
|
|
|
header("Cache-Control: no-cache");
|
|
|
|
|
|
|
|
|
|
$branch = 'develop';
|
|
|
|
|
if(array_key_exists('branch',$_REQUEST)){
|
|
|
|
|
if(in_array($_REQUEST['branch'], array('master', 'develop'))){
|
|
|
|
|
$branch = $_REQUEST['branch'];
|
|
|
|
|
}
|
|
|
|
|
$branch = $_GET['branch'];
|
|
|
|
|
if($branch=='develop'){
|
|
|
|
|
exec('e:\usr\Git\bin\sh.exe -c "export HOME=/e/usr;git pull" 2>&1', $out, $status);
|
|
|
|
|
}
|
|
|
|
|
$self_path=str_replace('\\','/',dirname(__FILE__));
|
|
|
|
|
//exec('e:\usr\Git\bin\sh.exe -c "export HOME=/e/usr;cd '.$self_path.';git pull" 2>&1', $out, $status);
|
|
|
|
|
//echo '"c:\Program Files\Git\bin\sh.exe" -c "export HOME=/c/Users/cht58;git checkout master -f;cd '.$self_path.';git pull" 2>&1';
|
|
|
|
|
exec('e:\usr\Git\bin\sh.exe -c "export HOME=/e/usr;git pull"', $out, $status);
|
|
|
|
|
if($branch=='master'){
|
|
|
|
|
exec('d:\.ssh\Git\bin\sh.exe -c "export HOME=/d;git pull" 2>&1', $out, $status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (0 === $status) {
|
|
|
|
|
print("Done");
|
|
|
|
|
} else {
|
|
|
|
|
header("Status: 500");
|
|
|
|
|
echo "Command failed status: $status <br/>";
|
|
|
|
|
header("Status: 404");
|
|
|
|
|
echo "Command failed with status: $status <br/>";
|
|
|
|
|
print_r($out);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|