diff --git a/api/v1/entries/ciresults.php b/api/v1/entries/ciresults.php new file mode 100644 index 0000000000..12cbc5d82b --- /dev/null +++ b/api/v1/entries/ciresults.php @@ -0,0 +1,30 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + */ +class ciresultsEntry extends entry +{ + /** + * POST method. + * + * @access public + * @return void + */ + public function post() + { + $control = $this->loadController('ci', 'commitResult'); + $control->commitResult(); + + $data = $this->getData(); + if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); + + $this->send(201, array()); + } +} diff --git a/config/routes.php b/config/routes.php index 035417268a..9bf2f07ad7 100644 --- a/config/routes.php +++ b/config/routes.php @@ -158,4 +158,6 @@ $routes['/z/files/:id/content'] = 'zfileContent'; $routes['/gitlab/webhook'] = 'gitlabWebhook'; +$routes['/ciresults'] = 'ciresults'; + $config->routes = $routes;