<?php exec('whoami 2>&1', $res); var_dump($res); exec('cd ' . dirname(__FILE__) . '/../ &&sudo git pull origin master 2>&1', $res, $rc); var_dump($rc); if ($rc == 0) { echo '部署成功<br>'; } else { echo '部署失败<br>'; } echo '<pre>'; var_dump($res); echo '</pre>'; echo '提交记录:<pre>'; exec('cd ' . dirname(__FILE__) . '/../ && git log -5 2>&1', $res1, $rc); var_dump($res1); echo '</pre>'; ?>
标签:excute,pull,dump,res,echo,__,rc,var,php From: https://www.cnblogs.com/guiyishanren/p/17492818.html