updateServer에 '마지막 서버'인 경우에는 git pull을 하도록 설정

This commit is contained in:
2018-04-01 03:31:03 +09:00
parent 543fc15553
commit dbc877023b
+20 -1
View File
@@ -34,7 +34,7 @@ $baseServerName = end(array_keys(AppConf::getList()));
$targetDir =$target.':'.$baseServerName;
if($server == $baseServerName || !key_exists($server, AppConf::getList())){
if(!key_exists($server, AppConf::getList())){
Json::die([
'result'=>false,
'reason'=>'불가능한 서버 이름입니다.'
@@ -65,6 +65,25 @@ if(!file_exists($server)){
mkdir($server, 0644);
}
if($server == $baseServerName){
exec("git pull 2>&1", $output);
if($output && $output[0] != 'Already up-to-date.'){
Json::die([
'result'=>false,
'reason'=>'git pull 작업 : '.join(', ', $output)
]);
}
//TODO: 버전명을 기록.
Json::die([
'result'=>true,
]);
}
exec("git fetch 2>&1", $output);
if($output){
Json::die([