Skip to content

Commit

Permalink
#12 : Remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas43000 committed Nov 20, 2020
1 parent f4bc6e2 commit 3b874f2
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/Platform/Console/Command/Environment/Database/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

namespace Kiboko\Cloud\Platform\Console\Command\Environment\Database;

use Deployer\Console\Application;
use Deployer\Deployer;
use Deployer\Host\Host;
use Deployer\Logger\Handler\FileHandler;
use Deployer\Logger\Handler\NullHandler;
use Deployer\Logger\Logger;
use Kiboko\Cloud\Domain\Environment\DTO\Context as EnvironmentContext;
use Kiboko\Cloud\Domain\Stack\DTO\Context as StackContext;
use Kiboko\Cloud\Platform\Console\EnvironmentWizard;
Expand Down Expand Up @@ -100,18 +95,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}

$application = new Application($this->console->getName());
$deployer = new Deployer($application);
$deployer['output'] = $output;
$deployer['log_handler'] = function ($deployer) {
return !empty($deployer->config['log_file'])
? new FileHandler($deployer->config['log_file'])
: new NullHandler();
};
$deployer['logger'] = function ($deployer) {
return new Logger($deployer['log_handler']);
};

$host = new Host($environementContext->deployment->server->hostname);
$host->port($environementContext->deployment->server->port);
$host->user($environementContext->deployment->server->username);
Expand Down Expand Up @@ -160,11 +143,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
$process2 = new Process(['ssh', '-t', $host->getUser().'@'.$host->getHostname(), 'docker', 'exec', $containerIds, '/usr/bin/mysqldump', '-u', $username, '--password='.$password, $databaseName, '>', $dumpPath]);
try {
$process2->mustRun();
if (!file_exists($host->getUser().'@'.$host->getHostname().':'.$dumpPath)) {
$format->error('Dump couldn\'t be created');

return 1;
}
$format->success('Dump well created at '.$host->getUser().'@'.$host->getHostname().':'.$dumpPath);

return 0;
Expand Down

0 comments on commit 3b874f2

Please sign in to comment.