Skip to content

Commit 7eb85f3

Browse files
authored
Merge pull request #3 from webteractive/fix-docker-compose-commands
Fix docker compose commands
2 parents ba00fb8 + 69f5d54 commit 7eb85f3

File tree

13 files changed

+89
-38
lines changed

13 files changed

+89
-38
lines changed

devstack

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@ if (file_exists($autoload = __DIR__ . '/vendor/autoload.php')) {
88
}
99

1010
use Webteractive\Devstack\App;
11-
use Webteractive\Devstack\Commands\MySql;
11+
use Webteractive\Devstack\Commands\Wp;
12+
use Webteractive\Devstack\Commands\Php;
13+
use Webteractive\Devstack\Commands\Init;
1214
use Webteractive\Devstack\Commands\Redis;
15+
use Webteractive\Devstack\Commands\MySql;
1316
use Webteractive\Devstack\Commands\Shell;
1417
use Webteractive\Devstack\Commands\Config;
15-
use Webteractive\Devstack\Commands\InitStack;
16-
use Webteractive\Devstack\Commands\RunPhpCommand;
17-
use Webteractive\Devstack\Commands\DownloadRuntimes;
18-
use Webteractive\Devstack\Commands\RunComposerCommands;
18+
use Webteractive\Devstack\Commands\Artisan;
19+
use Webteractive\Devstack\Commands\Download;
20+
use Webteractive\Devstack\Commands\Composer;
1921
use Webteractive\Devstack\RegisterDockerComposeCommands;
20-
use Webteractive\Devstack\Commands\RunLaravelArtisanCommand;
2122

22-
$app = new App('Devstack', '1.1.7');
23+
$app = new App('Devstack', '1.1.8');
2324

24-
$app->add(new InitStack);
25+
$app->add(new Init);
2526
$app->add(new Config);
26-
$app->add(new DownloadRuntimes);
27-
$app->add(new RunLaravelArtisanCommand);
28-
$app->add(new RunPhpCommand);
29-
$app->add(new RunComposerCommands);
27+
$app->add(new Download);
28+
$app->add(new Artisan);
29+
$app->add(new Php);
30+
$app->add(new Composer);
3031
$app->add(new Shell);
3132
$app->add(new MySql);
3233
$app->add(new Redis);
34+
$app->add(new Wp);
3335

3436
RegisterDockerComposeCommands::register($app);
3537

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use Webteractive\Devstack\Process;
66
use Webteractive\Devstack\WithSignalHandlers;
77

8-
class RunLaravelArtisanCommand extends Base
8+
class Artisan extends Base
99
{
1010
use WithSignalHandlers;
1111

1212
protected $signature = 'artisan';
13-
protected $description = 'Run Laravel\'s artisan command.';
13+
protected $description = 'Run <info>Laravel\'s artisan</info> command within the <info>app</info> container.';
1414

1515
public function shouldIgnoreValidationErrors(): bool
1616
{
@@ -35,7 +35,9 @@ public function handle(): int
3535
$process = Process::prepare(array_merge($command, $this->fullCommandSignature))
3636
);
3737

38-
$process->setTty(true)->run();
38+
$process->setTimeout(null)
39+
->setTty(true)
40+
->run();
3941

4042
return static::SUCCESS;
4143
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use Webteractive\Devstack\Process;
66
use Webteractive\Devstack\WithSignalHandlers;
77

8-
class RunComposerCommands extends Base
8+
class Composer extends Base
99
{
1010
use WithSignalHandlers;
1111

1212
protected $signature = 'composer';
13-
protected $description = 'Run composer commands.';
13+
protected $description = 'Run <info>composer</info> commands within the <info>app</info> container.';
1414

1515
public function shouldIgnoreValidationErrors(): bool
1616
{
@@ -35,7 +35,9 @@ public function handle(): int
3535
$process = Process::prepare(array_merge($command, $this->fullCommandSignature))
3636
);
3737

38-
$process->setTty(true)->run();
38+
$process->setTimeout(null)
39+
->setTty(true)
40+
->run();
3941

4042
return static::SUCCESS;
4143
}

src/Commands/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Config extends Base
99
use ShouldConfigure;
1010

1111
protected $signature = 'config';
12-
protected $description = 'Configure Devstack runtime settings';
12+
protected $description = 'Configure private devstack runtime settings.';
1313

1414
public function handle(): int
1515
{
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace Webteractive\Devstack\Commands;
44

55
use Webteractive\Devstack\Process;
6+
use Symfony\Component\Process\Process as SymfonyProcess;
67
use Webteractive\Devstack\WithSignalHandlers;
78

8-
class RunDockerCommands extends Base
9+
class DockerCompose extends Base
910
{
1011
use WithSignalHandlers;
1112

@@ -30,7 +31,9 @@ public function handle(): int
3031
$process = Process::prepare($commandSignature)
3132
);
3233

33-
$process->setTty(true)->run();
34+
$process->setTimeout(null)
35+
->setTty(true)
36+
->run();
3437

3538
return static::SUCCESS;
3639
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use Webteractive\Devstack\ShouldConfigure;
66
use Webteractive\Devstack\RuntimeDownloader;
77

8-
class DownloadRuntimes extends Base
8+
class Download extends Base
99
{
1010
use ShouldConfigure;
1111

1212
protected $signature = 'download';
13-
protected $description = 'Download latest runtimes';
13+
protected $description = 'Download latest private runtimes.';
1414

1515
public function handle(): int
1616
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Webteractive\Devstack\RuntimeDownloader;
88
use Webteractive\Devstack\PublicRuntimeDownloader;
99

10-
class InitStack extends Base
10+
class Init extends Base
1111
{
1212
use ShouldConfigure;
1313

src/Commands/MySql.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MySql extends Base
1515
{--u|user= : The user to use.}
1616
{--db|database= : The database to use.}
1717
{--env= : The path to the .env file. Default\'s to the current working directory.}';
18-
protected $description = 'Start a MySQL CLI session within the <comment>mysql</comment> container.';
18+
protected $description = 'Start a <info>MySQL CLI</info> session within the <info>mysql</info> container.';
1919

2020
public function handle(): int
2121
{
@@ -70,8 +70,7 @@ public function handle(): int
7070
);
7171

7272
$process->setTty(true)
73-
->setTimeout(60 * 60 * 2)
74-
->setIdleTimeout(60 * 60 * 8)
73+
->setTimeout(null)
7574
->run();
7675

7776
return static::SUCCESS;
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use Webteractive\Devstack\Process;
66
use Webteractive\Devstack\WithSignalHandlers;
77

8-
class RunPhpCommand extends Base
8+
class Php extends Base
99
{
1010
use WithSignalHandlers;
1111

1212
protected $signature = 'php';
13-
protected $description = 'Run PHP commands.';
13+
protected $description = 'Run <info>PHP</info> CLI within the <info>app</info> container.';
1414

1515
public function shouldIgnoreValidationErrors(): bool
1616
{
@@ -34,7 +34,9 @@ public function handle(): int
3434
$process = Process::prepare(array_merge($command, $this->fullCommandSignature))
3535
);
3636

37-
$process->setTty(true)->run();
37+
$process->setTimeout(null)
38+
->setTty(true)
39+
->run();
3840

3941
return static::SUCCESS;
4042
}

src/Commands/Redis.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Redis extends Base
1010
use WithSignalHandlers;
1111

1212
protected $signature = 'redis';
13-
protected $description = 'Start a Redis CLI session within the <comment>redis</comment> container.';
13+
protected $description = 'Start a <info>Redis CLI</info> session within the <info>redis</info> container.';
1414

1515
public function handle(): int
1616
{
@@ -20,8 +20,7 @@ public function handle(): int
2020
);
2121

2222
$process->setTty(true)
23-
->setTimeout(60 * 60 * 2)
24-
->setIdleTimeout(60 * 60 * 8)
23+
->setTimeout(null)
2524
->run();
2625

2726
return static::SUCCESS;

0 commit comments

Comments
 (0)