Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/Command/Tree.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

namespace Hypernode\Deploy\Command;

use Deployer\Deployer;
use Deployer\Command\TreeCommand;
use Symfony\Component\Console\Input\InputInterface as Input;
use Symfony\Component\Console\Output\OutputInterface as Output;
use Hypernode\Deploy\DeployRunner;
use Hypernode\Deploy\Exception\InvalidConfigurationException;
use Hypernode\Deploy\Exception\ValidationException;

class Tree extends TreeCommand
{
/**
* @var DeployRunner
*/
private $deployRunner;

public function __construct(
Deployer $deployer,
DeployRunner $deployRunner,
) {
parent::__construct($deployer);
$this->deployRunner = $deployRunner;
}

protected function execute(Input $input, Output $output): int
{
try {
$this->deployRunner->prepare(true, true, $input->getArgument('task'), false);
} catch (InvalidConfigurationException | ValidationException $e) {
$output->write($e->getMessage());
return 1;
}
$result = parent::execute($input, $output);

return $result;
}
}
2 changes: 1 addition & 1 deletion src/DeployRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function run(
* @throws InvalidConfigurationException
* @throws Throwable
*/
private function prepare(
public function prepare(
bool $configureBuildStage,
bool $configureServers,
string $stage,
Expand Down