|
4 | 4 |
|
5 | 5 | namespace Kiboko\Cloud\Platform\Console\Command\Environment\Database;
|
6 | 6 |
|
7 |
| -use Deployer\Console\Application; |
8 |
| -use Deployer\Deployer; |
9 | 7 | use Deployer\Host\Host;
|
10 |
| -use Deployer\Logger\Handler\FileHandler; |
11 |
| -use Deployer\Logger\Handler\NullHandler; |
12 |
| -use Deployer\Logger\Logger; |
13 | 8 | use Kiboko\Cloud\Domain\Environment\DTO\Context as EnvironmentContext;
|
14 | 9 | use Kiboko\Cloud\Domain\Stack\DTO\Context as StackContext;
|
15 | 10 | use Kiboko\Cloud\Platform\Console\EnvironmentWizard;
|
@@ -100,18 +95,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
100 | 95 | return 1;
|
101 | 96 | }
|
102 | 97 |
|
103 |
| - $application = new Application($this->console->getName()); |
104 |
| - $deployer = new Deployer($application); |
105 |
| - $deployer['output'] = $output; |
106 |
| - $deployer['log_handler'] = function ($deployer) { |
107 |
| - return !empty($deployer->config['log_file']) |
108 |
| - ? new FileHandler($deployer->config['log_file']) |
109 |
| - : new NullHandler(); |
110 |
| - }; |
111 |
| - $deployer['logger'] = function ($deployer) { |
112 |
| - return new Logger($deployer['log_handler']); |
113 |
| - }; |
114 |
| - |
115 | 98 | $host = new Host($environementContext->deployment->server->hostname);
|
116 | 99 | $host->port($environementContext->deployment->server->port);
|
117 | 100 | $host->user($environementContext->deployment->server->username);
|
@@ -160,11 +143,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
160 | 143 | $process2 = new Process(['ssh', '-t', $host->getUser().'@'.$host->getHostname(), 'docker', 'exec', $containerIds, '/usr/bin/mysqldump', '-u', $username, '--password='.$password, $databaseName, '>', $dumpPath]);
|
161 | 144 | try {
|
162 | 145 | $process2->mustRun();
|
163 |
| - if (!file_exists($host->getUser().'@'.$host->getHostname().':'.$dumpPath)) { |
164 |
| - $format->error('Dump couldn\'t be created'); |
165 |
| - |
166 |
| - return 1; |
167 |
| - } |
168 | 146 | $format->success('Dump well created at '.$host->getUser().'@'.$host->getHostname().':'.$dumpPath);
|
169 | 147 |
|
170 | 148 | return 0;
|
|
0 commit comments