Initial commit.

This commit is contained in:
Dan Cryer 2013-05-03 16:02:53 +01:00
commit 2c860e8009
43 changed files with 12560 additions and 0 deletions

View file

@ -0,0 +1,30 @@
<?php
namespace PHPCI\Controller;
use b8,
b8\Store,
PHPCI\Model\Build;
class GithubController extends b8\Controller
{
public function init()
{
$this->_buildStore = Store\Factory::getStore('Build');
}
public function index()
{
$payload = json_decode($this->getParam('payload'));
$build = new Build();
$build->setProjectId($this->getParam('project'));
$build->setCommitId($payload['after']);
$build->setStatus(0);
$build->setLog('');
$build->setBranch(str_replace('refs/heads/', '', $payload['ref']));
$this->_buildStore->save($build);
die('OK');
}
}