コード例 #1
0
 private function getStatus(HarbormasterBuild $build)
 {
     $status_view = new PHUIStatusListView();
     $item = new PHUIStatusItemView();
     if ($build->isStopping()) {
         $status_name = pht('Pausing');
         $icon = PHUIStatusItemView::ICON_RIGHT;
         $color = 'dark';
     } else {
         $status = $build->getBuildStatus();
         $status_name = HarbormasterBuild::getBuildStatusName($status);
         $icon = HarbormasterBuild::getBuildStatusIcon($status);
         $color = HarbormasterBuild::getBuildStatusColor($status);
     }
     $item->setTarget($status_name);
     $item->setIcon($icon, $color);
     $status_view->addItem($item);
     return $status_view;
 }
コード例 #2
0
 private function updateBuild(HarbormasterBuild $build)
 {
     if ($build->getBuildStatus() == HarbormasterBuild::STATUS_PENDING || $build->isRestarting()) {
         $this->restartBuild($build);
         $build->setBuildStatus(HarbormasterBuild::STATUS_BUILDING);
         $build->save();
     }
     if ($build->isResuming()) {
         $build->setBuildStatus(HarbormasterBuild::STATUS_BUILDING);
         $build->save();
     }
     if ($build->isStopping() && !$build->isComplete()) {
         $build->setBuildStatus(HarbormasterBuild::STATUS_STOPPED);
         $build->save();
     }
     $build->deleteUnprocessedCommands();
     if ($build->getBuildStatus() == HarbormasterBuild::STATUS_BUILDING) {
         $this->updateBuildSteps($build);
     }
 }