Small fixes
This commit is contained in:
parent
9b9d1b1122
commit
cb4d7a268e
|
@ -15,8 +15,6 @@ use Psr\Log\LogLevel;
|
|||
use PHPCensor\Plugin\Util\Factory as PluginFactory;
|
||||
|
||||
/**
|
||||
* PHPCI Build Runner
|
||||
*
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class Builder implements LoggerAwareInterface
|
||||
|
@ -119,7 +117,7 @@ class Builder implements LoggerAwareInterface
|
|||
$this->verbose
|
||||
);
|
||||
|
||||
$this->interpolator = new BuildInterpolator();
|
||||
$this->interpolator = new BuildInterpolator();
|
||||
$this->buildErrorWriter = new BuildErrorWriter($this->build->getId());
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace PHPCensor\Model;
|
||||
|
||||
use PHPCensor\Builder;
|
||||
use PHPCensor\Store\BuildErrorWriter;
|
||||
use Symfony\Component\Yaml\Parser as YamlParser;
|
||||
use PHPCensor\Model;
|
||||
use b8\Store\Factory;
|
||||
|
@ -21,6 +20,11 @@ class Build extends Model
|
|||
const STAGE_FAILURE = 'failure';
|
||||
const STAGE_FIXED = 'fixed';
|
||||
const STAGE_BROKEN = 'broken';
|
||||
|
||||
const STATUS_PENDING = 0;
|
||||
const STATUS_RUNNING = 1;
|
||||
const STATUS_SUCCESS = 2;
|
||||
const STATUS_FAILED = 3;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
@ -669,11 +673,6 @@ class Build extends Model
|
|||
return Factory::getStore('BuildMeta', 'PHPCensor')->getByBuildId($this->getId());
|
||||
}
|
||||
|
||||
const STATUS_PENDING = 0;
|
||||
const STATUS_RUNNING = 1;
|
||||
const STATUS_SUCCESS = 2;
|
||||
const STATUS_FAILED = 3;
|
||||
|
||||
public $currentBuildPath;
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,7 +56,7 @@ class BuildService
|
|||
$build = new Build();
|
||||
$build->setCreated(new \DateTime());
|
||||
$build->setProject($project);
|
||||
$build->setStatus(0);
|
||||
$build->setStatus(Build::STATUS_PENDING);
|
||||
$build->setEnvironment($environment);
|
||||
|
||||
$branches = $project->getBranchesByEnvironment($environment);
|
||||
|
@ -118,8 +118,9 @@ class BuildService
|
|||
$build = new Build();
|
||||
$build->setValues($data);
|
||||
$build->setCreated(new \DateTime());
|
||||
$build->setStatus(0);
|
||||
$build->setStatus(Build::STATUS_PENDING);
|
||||
|
||||
/** @var Build $build */
|
||||
$build = $this->buildStore->save($build);
|
||||
|
||||
$buildId = $build->getId();
|
||||
|
|
|
@ -20,6 +20,7 @@ class BuildErrorWriter
|
|||
|
||||
/**
|
||||
* BuildErrorWriter constructor.
|
||||
*
|
||||
* @param int $build_id
|
||||
* @param int $buffer_size
|
||||
*/
|
||||
|
@ -39,12 +40,13 @@ class BuildErrorWriter
|
|||
|
||||
/**
|
||||
* Write error
|
||||
* @param string $plugin
|
||||
* @param string $message
|
||||
* @param int $severity
|
||||
* @param string $file
|
||||
* @param int $line_start
|
||||
* @param int $line_end
|
||||
*
|
||||
* @param string $plugin
|
||||
* @param string $message
|
||||
* @param int $severity
|
||||
* @param string $file
|
||||
* @param int $line_start
|
||||
* @param int $line_end
|
||||
* @param \DateTime $created_date
|
||||
*/
|
||||
public function write($plugin, $message, $severity, $file = null, $line_start = null, $line_end = null, $created_date = null)
|
||||
|
|
Loading…
Reference in a new issue