Initial commit.
This commit is contained in:
commit
2c860e8009
43 changed files with 12560 additions and 0 deletions
30
PHPCI/Controller/GithubController.php
Normal file
30
PHPCI/Controller/GithubController.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue