* @package PHPCI * @subpackage Core */ class Build extends BuildBase { const STATUS_NEW = 0; const STATUS_RUNNING = 1; const STATUS_SUCCESS = 2; const STATUS_FAILED = 3; public $currentBuildPath = null; /** * Get link to commit from another source (i.e. Github) */ public function getCommitLink() { return '#'; } /** * @return string */ public function getProjectTitle() { $project = $this->getProject(); return $project ? $project->getTitle() : ""; } /** * Get link to branch from another source (i.e. Github) */ public function getBranchLink() { return '#'; } /** * Send status updates to any relevant third parties (i.e. Github) */ public function sendStatusPostback() { return; } /** * Store build metadata */ public function storeMeta($key, $value) { $value = json_encode($value); Factory::getStore('Build')->setMeta($this->getProjectId(), $this->getId(), $key, $value); } /** * Is this build successful? */ public function isSuccessful() { return ($this->getStatus() === self::STATUS_SUCCESS); } }