summaryrefslogtreecommitdiff
path: root/src/Command/RunCommand.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-04-28 13:57:52 +0200
committerDaniel Weipert <code@drogueronin.de>2021-04-28 13:57:52 +0200
commitd91225375883a85fa6fddccc9ac00103e1d32eac (patch)
treed1b9e13e7f00aabce7ad310a1d43c30dc92e3a88 /src/Command/RunCommand.php
parentf7fc6fd54a5f750de8144b9b05d5ac173470c70a (diff)
Reconnects after ssh timeoutv1.0.0
Diffstat (limited to 'src/Command/RunCommand.php')
-rw-r--r--src/Command/RunCommand.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php
index cc9c7fd..e76c063 100644
--- a/src/Command/RunCommand.php
+++ b/src/Command/RunCommand.php
@@ -5,6 +5,7 @@ namespace PHPIAC\Command;
use PHPIAC\Connection;
use PHPIAC\Task;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -28,21 +29,25 @@ class RunCommand extends Command
{
$config = include $input->getOption('config');
- Connection::getInstance($config['host'], $config['user'], $config['private_key_file']);
+ Connection::initialize($config['host'], $config['user'], $config['private_key_file']);
+
+ /**@var FormatterHelper $formater*/
+ $formater = $this->getHelper('formatter');
foreach ($config['tasks'] as $task) {
/**@var Task $task*/
+ $output->writeln($task->getName());
if (! $task->module->checkState()) {
- $output->writeln($task->getName());
$output->writeln('Running');
- $task->module->getCommands();
+ $task->module->execute();
}
else {
- $output->writeln($task->getName());
$output->writeln('Skipping');
}
+
+ $output->writeln('- - -');
}
return Command::SUCCESS;