Exemplo n.º 1
0
 /**
  * 部署前置触发任务
  * 在部署代码之前的准备工作,如git的一些前置检查、vendor的安装(更新)
  *
  * @return bool
  * @throws \Exception
  */
 private function _preDeploy()
 {
     $task = new WalleTask();
     $sTime = Command::getMs();
     $task->setConfig($this->conf);
     $ret = $task->preDeploy($this->task->link_id);
     // 记录执行时间
     $duration = Command::getMs() - $sTime;
     Record::saveRecord($task, $this->task->id, Record::ACTION_PRE_DEPLOY, $duration);
     if (!$ret) {
         throw new \Exception('前置任务操作失败');
     }
     return true;
 }