Inheritance: extends Command
Esempio n. 1
0
 /**
  * 更新代码文件
  *
  * @return bool
  * @throws \Exception
  */
 private function _gitUpdate()
 {
     // 更新代码文件
     $git = new Git();
     $sTime = Command::getMs();
     $ret = $git->setConfig($this->conf)->updateToVersion($this->task->commit_id, $this->task->link_id);
     // 更新到指定版本
     // 记录执行时间
     $duration = Command::getMs() - $sTime;
     Record::saveRecord($git, $this->task->id, Record::ACTION_CLONE, $duration);
     if (!$ret) {
         throw new \Exception('更新代码文件出错');
     }
     return true;
 }