Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment commands for deployment #13

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
88bb5b9
Update README.md
gplanchat Aug 5, 2020
60a3705
Update README.md
gplanchat Aug 5, 2020
9200f7d
Added Dejavu enable/disable switch
gplanchat Sep 11, 2020
a075f5c
update doc
sylvainraye Sep 21, 2020
2841eb3
Merge pull request #11 from diglin/master
gplanchat Sep 23, 2020
762af97
#12 : add environment:init
nicolas43000 Sep 23, 2020
3bb55d9
#12 : refacto
nicolas43000 Sep 24, 2020
4afd180
#12 : big commit adding DTO, some refacto, get and list command
nicolas43000 Sep 30, 2020
de6bd0a
Merge remote-tracking branch 'origin/master' into feature/12-add-envi…
nicolas43000 Sep 30, 2020
5c58d79
#12 : refacto
nicolas43000 Sep 30, 2020
2e5bdf5
#12 : Add Set & Unset commands + changed PHP requirements + small cs …
nicolas43000 Oct 2, 2020
3174ade
#12 : fix
nicolas43000 Oct 2, 2020
890f79b
#12 : Add deploy, destroy and rsync commands
nicolas43000 Oct 6, 2020
ae22456
#12 : Add cache clear, start and stop commands
nicolas43000 Oct 6, 2020
8f6e466
Merge remote-tracking branch 'origin/master' into feature/12-add-envi…
nicolas43000 Oct 6, 2020
a7100cb
Merge remote-tracking branch 'origin/master' into feature/12-add-envi…
nicolas43000 Nov 17, 2020
a7ba45a
#12 : Run `composer update nothing` after merge
nicolas43000 Nov 17, 2020
8d73483
#12 : fix yaml indent and default dbms to null
nicolas43000 Nov 20, 2020
f4bc6e2
#12 : Add database:dump and variable:add commands
nicolas43000 Nov 20, 2020
3b874f2
#12 : Remove useless code
nicolas43000 Nov 20, 2020
e70ba8b
#12 : Add database:load cmd and timeout(0) to database:dump cmd
nicolas43000 Nov 20, 2020
4bc7a60
#12 : Add shell cmd
nicolas43000 Nov 20, 2020
f1db046
#12 : Add doc to README.md
nicolas43000 Nov 20, 2020
5852e9f
Merge branch 'master' into feature/12-add-environment-commands
gplanchat Nov 25, 2020
5fc566c
Updated retrieved lost docs about environment commands
gplanchat Nov 25, 2020
4c1e9d9
#12 : Add proxy command for port forwarding
nicolas43000 Dec 10, 2020
eee91d7
Merge branch 'feature/12-add-environment-commands' of github.com:kibo…
nicolas43000 Dec 10, 2020
71b9ace
Merge branch 'master' into feature/12-add-environment-commands
gplanchat Dec 14, 2020
1684b03
Remove typo
sebprt Dec 22, 2020
c556e8a
Fix dump and load commands : Create Normalizer and a second Finder in…
sebprt Dec 22, 2020
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
Prev Previous commit
Next Next commit
#12 : Remove useless code
nicolas43000 committed Nov 20, 2020
commit 3b874f2be0cfdd008bc3e6bf5dc518cedeb738ac
22 changes: 0 additions & 22 deletions src/Platform/Console/Command/Environment/Database/DumpCommand.php
Original file line number Diff line number Diff line change
@@ -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;
@@ -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);
@@ -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;