Use sensiolabs/ansi-to-html to parse the build logs.
Added an AnsiConverter helper. Use the AnsiConverter in the email and page templates that display the build log. Use a dedicated stylesheet for the ANSI converter. It can be customized. It can be inlined in the notifications. Do not use ProphecyTestCase when not needed.
This commit is contained in:
parent
039324c056
commit
d804438a87
9 changed files with 162 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ use b8;
|
|||
use b8\Exception\HttpException\NotFoundException;
|
||||
use b8\Http\Response\JsonResponse;
|
||||
use PHPCI\BuildFactory;
|
||||
use PHPCI\Helper\AnsiConverter;
|
||||
use PHPCI\Helper\Lang;
|
||||
use PHPCI\Model\Build;
|
||||
use PHPCI\Model\Project;
|
||||
|
|
@ -198,11 +199,7 @@ class BuildController extends \PHPCI\Controller
|
|||
*/
|
||||
protected function cleanLog($log)
|
||||
{
|
||||
$log = str_replace('[0;32m', '<span style="color: green">', $log);
|
||||
$log = str_replace('[0;31m', '<span style="color: red">', $log);
|
||||
$log = str_replace('[0m', '</span>', $log);
|
||||
|
||||
return $log;
|
||||
return AnsiConverter::convert($log);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue