git自动部署git钩子

public function pull()
{
$rowData = file_get_contents(‘php://input’, ‘r’);得到参数
r o w D a t a = j s o n d e c o d e ( rowData = json_decode( rowData=jsondecode(rowData,true);
file_put_contents(‘auto.php’, var_export($rowData,TRUE), FILE_APPEND);

//var_dump($num);die;

  if(isset($rowData['project']) && isset($rowData['project']['name']) && $rowData['project']['name']){
        file_put_contents(auto_pull.sh, 'cd /www/html/front_dist; git pull');
        system(auto_pull.sh);拉取文件,注意文件权限777
        echo 'success';
    }else{
        echo 'error';
    }
    
}

猜你喜欢

转载自blog.csdn.net/hanxiaoyang6/article/details/114669059
今日推荐