Exemplo n.º 1
0
 public static function getChanges($branch, $bundleId)
 {
     $changes = Application_Model_BundlePeer::getChanges($branch, $bundleId);
     $change = new Application_Model_Change();
     $change->id = $bundleId;
     $change->msg = $changes;
     return array($change);
 }
Exemplo n.º 2
0
 public function indexAction()
 {
     $regex = $this->getInvokeArg('bootstrap')->getOption('paramregex');
     $branch = preg_match($regex['branch'], $this->_getParam('branch')) === 0 ? 'trunk' : $this->_getParam('branch');
     $data = $this->getEmptyResult();
     $data['results'] = Application_Model_BundlePeer::getBundles($branch);
     $this->getResponse()->setBody(json_encode($data));
     $this->getResponse()->setHttpResponseCode(200);
 }
Exemplo n.º 3
0
 public static function getJobResults($branch, $bundleId, $stage)
 {
     $jobResultFileContent = Application_Model_BundlePeer::getJobResults($branch, $bundleId, $stage);
     $jobResultStrings = explode("\n", $jobResultFileContent);
     sort($jobResultStrings, SORT_REGULAR);
     $jobResults = array();
     foreach ($jobResultStrings as $string) {
         $jobResult = self::getJobResultFromString($string);
         $jobResult->id = $bundleId;
         $jobResults[] = $jobResult;
     }
     return $jobResults;
 }
Exemplo n.º 4
0
 public function postAction()
 {
     $branch = $this->_getParam('branch');
     $bundle = $this->_getParam('bundle');
     $comment = $this->_getParam('comment');
     $regex = $this->getInvokeArg('bootstrap')->getOption('paramregex');
     if (preg_match($regex['branch'], $branch) === 0) {
         throw new Exception("No valid branch for editing comment specified: '{$branch}'");
     }
     if (empty($bundle)) {
         throw new Exception("No bundle for editing comment specified");
     }
     Application_Model_BundlePeer::setComment($branch, $bundle, $comment);
     $this->getResponse()->setBody(json_encode(array('success' => true)));
     $this->getResponse()->setHttpResponseCode(200);
 }
Exemplo n.º 5
0
 public function testSetComment()
 {
     $data = Application_Model_BundlePeer::setComment('branchA', '88.941106ff.2', 'Super build!');
     $this->assertNotEquals('false', $data);
     $data = Application_Model_BundlePeer::getComment('branchA', '88.941106ff.2');
     $this->assertEquals('Super build!', $data);
     unlink(Zend_Registry::get("repodir") . '/branchA/88.941106ff.2/metadata/comment');
 }