User services in rebuild command.
This commit is contained in:
parent
6a43003f24
commit
7e71e2ec7b
|
@ -56,13 +56,19 @@ class RebuildCommand extends Command
|
||||||
*/
|
*/
|
||||||
protected $buildService;
|
protected $buildService;
|
||||||
|
|
||||||
public function __construct(Logger $logger, BuildStore $buildStore, BuildService $buildService)
|
/**
|
||||||
|
* @param RunCommand
|
||||||
|
*/
|
||||||
|
protected $runCommand;
|
||||||
|
|
||||||
|
public function __construct(Logger $logger, BuildStore $buildStore, BuildService $buildService, RunCommand $runCommand)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->buildStore = $buildStore;
|
$this->buildStore = $buildStore;
|
||||||
$this->buildService = $buildService;
|
$this->buildService = $buildService;
|
||||||
|
$this->runCommand = $runCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configure()
|
protected function configure()
|
||||||
|
@ -77,11 +83,8 @@ class RebuildCommand extends Command
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$runner = new RunCommand($this->logger);
|
$this->runCommand->setMaxBuilds(1);
|
||||||
$runner->setMaxBuilds(1);
|
$this->runCommand->setDaemon(false);
|
||||||
$runner->setDaemon(false);
|
|
||||||
|
|
||||||
$service = new BuildService($this->buildStore);
|
|
||||||
|
|
||||||
$builds = $this->buildStore->getLatestBuilds(null, 1);
|
$builds = $this->buildStore->getLatestBuilds(null, 1);
|
||||||
$lastBuild = array_shift($builds);
|
$lastBuild = array_shift($builds);
|
||||||
|
|
|
@ -81,6 +81,7 @@ services:
|
||||||
- @console.logger
|
- @console.logger
|
||||||
- @storage.build
|
- @storage.build
|
||||||
- @service.build
|
- @service.build
|
||||||
|
- @console.command.run
|
||||||
console.command.update:
|
console.command.update:
|
||||||
class: PHPCI\Command\UpdateCommand
|
class: PHPCI\Command\UpdateCommand
|
||||||
arguments:
|
arguments:
|
||||||
|
|
Loading…
Reference in a new issue